string s = "Success!\n" ; for(int i=0; i<7; ++i) cout << s[i];
I found that I need to increase the for loop to i<9 or maybe i<10
Robert Ryan <[EMAIL PROTECTED]> wrote:
thanks, you are right...one more s than needed
#include "../../std_lib_facilities.h"
int main()
try {
string s = "Success!\n"; for(int i=0; i<7; ++i) cout << s[i];
return 0;
}
catch(exception& e) {
cerr << "error: " << e.what() << '\n';
keep_window_open();
return 1;
}
catch( ... ) {
cerr << "Oops: unknown exception!\n";
keep_window_open();
return 1;
}
how would you make 'Press any key go the next line.
SuccessPress any key to continue . . .
if you put cout << s[i] << '\n'; it goes down
"Brett W. McCoy" <[EMAIL PROTECTED]> wrote:
On 2/7/07, Robert Ryan <[EMAIL PROTECTED]> wrote: #include
"../../std_lib_facilities.h"
int main()
try {
vector<char> v(5); for(int i = 0; 0<v.sizez(); ++i);
return 0;
}
catch(exception& e) {
cerr << "error: " << e.what() << '\n';
keep_window_open();
return 1;
}
catch( ... ) {
cerr << "Oops: unknown exception!\n";
keep_window_open();
return 1;
}
the error i get is
vector<char> v(5); for(int i = 0; 0<v.sizez(); ++i);
sizez: is not a member of 'Vector <T>'
This one is obvious... did you check your STL documentation on what methods are
available for the vector template class? Hint: you have one more z in the
method than you need...
-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
If I were to divulge it, it would overturn the world."
-- Jelaleddin Rumi
---------------------------------
Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
---------------------------------
Get your own web address.
Have a HUGE year through Yahoo! Small Business.