I"m obtaining this error "Expression did no evaluate come a constant" when declaring a string in intuitive Studio;string data;


You are watching: Expression did not evaluate to a constant

Reply v Quote
*

Super ModeratorPower Poster
All advice is available in great faith only. All my password is tested (unless proclaimed explicitly otherwise) v the latest version of Microsoft intuitive Studio (using the supported features of the latest standard) and is readily available as examples only - not as production quality. I cannot market advice about any various other c/c++ compiler/IDE or incompatibilities with VS. Girlfriend are ultimately responsible for the impacts of your programs and also the truth of the devices they operation on. Anything i post, password snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be provided without reference or acknowledgement. Likewise note that ns only administer advice and also guidance via the medtox.org - and also not via personal messages!C++20 Compiler: Microsoft VS2019 (16.11.5)
Reply v Quote
Member

int inc = 0; wire line; varCount1 = 0; ifstream ddt( "file.dat" ); if (ddt) when (getline( ddt, line)) if( varCount1 == 1 ) inc = atoi(line.c_str()); varCount1++; wallet1.close(); cable data;
Sorry, you can"t execute that in c++. In ~ compile time the compiler needs to recognize the dimension of the array. If friend only understand the dimension at run-time climate you need to think about using a container such as a vector. Check out http://www.cplusplus.com/reference/vector/vector/ - or if absolutely crucial then use dynamic memory.What are you trying to achieve?
All advice is readily available in good faith only. All my code is experiment (unless proclaimed explicitly otherwise) through the latest version of Microsoft visual Studio (using the supported functions of the latest standard) and also is readily available as instances only - not as production quality. Ns cannot sell advice about any various other c/c++ compiler/IDE or incompatibilities v VS. You are ultimately responsible for the results of your programs and also the truth of the makers they operation on. Anything i post, password snippets, advice, and so on is licensed together Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and also can be supplied without reference or acknowledgement. Additionally note that ns only provide advice and guidance via the medtox.org - and also not via private messages!C++20 Compiler: Microsoft VS2019 (16.11.5)


See more: The Last Person You Think About Before Falling Asleep, The Person You Think About Before You Fall Asleep

I"m obtaining this error "Expression did not evaluate to a constant" when declaring a cable in visual Studio;string data;