Back | Reverse | Quick Reply | Post Reply |

C++ Problem
Link | by Krad420 on 2007-03-05 17:06:53
ehhmmm I Know this is somehow Baka....
it´s been a while since i used this program

could you please tell me how to put a sentence in diferent lines?

Example

I Am Krad

....I want to do this

I
Am
Krad

....Got it??
please can you help me :D
Krad out

Photo Sharing and Video Hosting at Photobucket

Re: C++ Problem
Link | by ArrowHead on 2007-03-06 17:53:40
What are you asking? 1/print output in different lines OR 2/put source code in different line?
for 1/ you can use "\n" to print newline character so that the pointer will move to the next line
for 2/ C++ code can be read even not in the same line. But I think solution 1/ is what you're looking for.

I'm not very good at C++ either

Re: C++ Problem
Link | by プロメテウス on 2007-03-07 09:56:09
Hi.

I suppose you are writing a normal console program? In this case you would do as ArrowHead just said:

#include
using namespace std;

int main(void)
{
cout << "I" << endl; // endl = endline, creates a new line
cout << "Am\r\n"; // as ArrowHead said, \n = newline (\r performs a "carriage return"
cout << "Krad" << endl;

return 0;
}

That's how you do it in console mode.

Back | Reverse | Quick Reply | Post Reply |

Copyright 2000-2024 Gendou | Terms of Use | Page loaded in 0.0021 seconds at 2024-04-28 00:33:14