Changes

Jump to: navigation, search

C/C++ FAQ

741 bytes added, 15:03, 23 September 2013
C/C++ FAQ
Q: How do you get the length of a file / read the entire file without explicitly knowing its length,
and how do you use that data afterwards?
Q: How do you compile the happy face on matrix? What is correct way to use CIO library in matrix?
</pre>
'''Q:''' Why is the postfix increment/decrement operator (e.g. a++ and a--) evaluated differently on different compilers?<br>
</source>
For any of these methods, to be able to work with the data afterwords simply use a common delimiter when originally generating the file, and then you can use methods like [http://www.cplusplus.com/reference/clibrary/cstring/strtok/ strtok] (for char array), [http://www.cplusplus.com/reference/string/string/find/ .find] combined with [http://www.cplusplus.com/reference/string/string/substr/ .substr] (string class) or use it as a vector (if that's required).<br>Submitted by Team42.<br><br>
 
Q: How do you compile the happy face on matrix? What is correct way to use CIO library in matrix?
Details of problem/question: The CIO library files (console.h, console.cpp, keys.h) and Happyface.cpp were transferred to Documents\A_1 folder on zenit. And when attempt was made to compile happyface.cpp, the lots of errors were generated that stated
"undefined reference to 'cio::console' or
"undefined reference to 'cio::console::(some function)'.
 
You can find the happyface.cpp at https://scs.senecac.on.ca/~btp300/pages/content/names.html (just scroll to the bottom)
 
This just happens only on zenit. The program works ok on visual studio.

Navigation menu