I have stored values in an array and I printed it out. The output looks like the following:
4
5
A
9
L
I want my output prints in a horizantale line. Any one know how ?
This is a discussion on array output within the C++ Programming forums, part of the General Programming Boards category; I have stored values in an array and I printed it out. The output looks like the following: 4 5 ...
I have stored values in an array and I printed it out. The output looks like the following:
4
5
A
9
L
I want my output prints in a horizantale line. Any one know how ?
yes - use space as a delimiter, not a new line
If I have eight hours for cutting wood, I spend six sharpening my axe.
Can you give me an example ? because I am not quite sure about how to use it ?
This is what I have:
Code:void printCode() { for(int i = 0; i< 13; i++) { result+=billy[i]; //cout<<billy[i]<<endl; } cout<<result<<endl; return 0; }
okay, it could only work if my code contains all of one type but my code is all string? Once I set the result to a string type it sends an error.
Post actual code and actual error messages.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I support http://www.ukip.org/ as the first necessary step to a free Europe.
If you do cout << something << endl you get a newline each time.
Same with cout << something << "\n". But if you just do cout << something, then you don't get a new line.
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^