Storing Strings
I am admittedly a newbie, but working on amending that. My newest learning experience is something that has frustrated me in the past, but now I find something fantastic and .... can't make it work!
Trying to use the type Code:
string Code:
#include <string> Code:
#include <iostream> C++/test.cpp:10:2: warning: no newline at end of file It compiles, and creates the executable, which when ran displays nothing. Why is it not displaying the output as I would expect: Quote:
|
Hi,
I cannot reproduce your problem, your code works for me as expected - I have g++ 3.3.1 though. Does your program work without using std::string? How do you compile your program? So long... bruce |
The warning is because your last line is probably } instead of a blank line. No big deal.
The reason it probably isn't displaying anything is because you are probably running the Linux test program. try typing which test And you will probably get the result: /usr/bin/test To run your own test program, try executing it like so: ./test |
To answer bruce ford, no.
Code:
#include <iostream> Quote:
Thanks a million, I had no idea what the Linux "test" program was. |
hi rebel,
great that things are solved. No I didn't mean to take out the 'using namespace std;' line but to use char* instead of string. Have fun, bruce |
All times are GMT -5. The time now is 01:18 AM. |