|
|
main.cpp:11: error: array must be initialized with a brace-enclosed initializer main.cpp:12: error: array must be initialized with a brace-enclosed initializer main.cpp: In function ‘void New()’: main.cpp:81: error: cannot convert ‘char*’ to ‘char**’ for argument ‘1’ to ‘__ssize_t getline(char**, size_t*, FILE*)’ main.cpp:95: error: incompatible types in assignment of ‘const char’ to ‘char [255]’ main.cpp:100: error: incompatible types in assignment of ‘const char’ to ‘char [255]’ main.cpp: In function ‘void Existing(char)’: main.cpp:117: error: invalid conversion from ‘char’ to ‘const char*’ main.cpp:117: error: initializing argument 1 of ‘void std::basic_ifstream<_CharT, _Traits>::open(const char*, std::_Ios_Openmode) [with _CharT = char, _Traits = std::char_traits<char>]’ main.cpp:121: error: incompatible types in assignment of ‘const char’ to ‘char [255]’ main.cpp:126: error: invalid conversion from ‘void*’ to ‘char**’ main.cpp:126: error: cannot convert ‘char*’ to ‘size_t*’ for argument ‘2’ to ‘__ssize_t getline(char**, size_t*, FILE*)’ |
|
|
getline(text, 16384,'~');
http://www.cplusplus.com/reference/iostream/istream/getline/filename = NULLSTRING
, Line 100,121 filename = NULLSTRING;
, NULLSTRING is a character, you can't use assignment with arrays fin.open(nameasarg);
nameasarg is a single charconst char
to char[16] but it says the arrays should be initialized inside braces. That cannot be done here since I want to keep the scope of NULLSTRING global... Enclosing it in braces would limit the scope.getline().
namesarg[]
as an argument to the function?By the way what is the difference between a string and an array of characters? |
|
|
I also tries to change NULLSTRING form const char to char[16] but it says the arrays should be initialized inside braces. That cannot be done here since I want to keep the scope of NULLSTRING global... Enclosing it in braces would limit the scope. |
char NULLSTRING[16] = { ' ' };
const&
thing if you want.
|
|
|
|
structmem.c_str()
works without #include <cstring>
... But I have included it anyway.