Как поместить символ, переданный через командную строку, в переменную типа char [закрыто] ⇐ C++
-
Гость
Как поместить символ, переданный через командную строку, в переменную типа char [закрыто]
The delimiter=" parameter is entered into the console. You need to put the quoted character in the variable char d. For example, if delimiter='x' , then d = 'x'. В кавычках может передаваться только один символ. Также символом может являться специальные символы такие как '\n','t','"' и другие.
#include using namespace std; int main(int argc,char* argv[]) { char d = '\n'; d = argv[1][13]; } The main problem is that the ' character breaks my string
The delimiter=" parameter is entered into the console. You need to put the quoted character in the variable char d. For example, if delimiter='x' , then d = 'x'. В кавычках может передаваться только один символ. Также символом может являться специальные символы такие как '\n','t','"' и другие.
#include using namespace std; int main(int argc,char* argv[]) { char d = '\n'; d = argv[1][13]; } The main problem is that the ' character breaks my string
Мобильная версия