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 ?
Printable View
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
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 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.