![]() |
|
|
|
#1
|
||||
|
||||
|
Someone teach me how to use the // in C++ programming
#include <iostream> using namespace std; int main() { cout<<"Hello World\n"; cin.get(); return 0; } Where do I put the "//" or "/*" "*/"
__________________
![]() IM PROUD TO BE A MEMBER OF PSP HACKS FORUMS
|
|
#2
|
||||
|
||||
|
they can be placed anywhere
doesnt matter, just dont try to put code after the comment on the line, before it fine also you do not need the cin.get(); |
|
#3
|
||||
|
||||
|
by the way
what does the // do? It doesn't appear
__________________
![]() IM PROUD TO BE A MEMBER OF PSP HACKS FORUMS
|
|
#4
|
||||
|
||||
|
It's for comments, eg.
Code:
/* Test code
For testing purposes */
#include <iostream>
using namespace std;
int main()
{
cout<<"Hello World\n"; //This is the code to display "Hello World"
cin.get();
return 0;
}
__________________
|
|
#5
|
||||
|
||||
|
Quote:
__________________
![]() IM PROUD TO BE A MEMBER OF PSP HACKS FORUMS
|
|
#6
|
||||
|
||||
|
all the program is doing is displaying a line
and the cin.get just delays (until enter is pushed) the press any key to continue |
|
#7
|
||||
|
||||
|
Learn Python.
__________________
killaj said: there is one answer to one simple question as to whether a girl is attractive or not. One all-inclusive, unbelievably powerful question that you must ask yourself to determine if you think a girl is hot or not. Do you know what that question is? "Would I hit it?" If your answer is "yes", then that's all you need to know. Hit that shit. If your answer is "no", then leave it be. Quote:
|
|
#8
|
||||
|
||||
|
Learn to STFU.
@zeferino: are you trying to learn by examples? Because I'm pretty sure most tutorials make that clear that that's a comment... |
|
#9
|
|||
|
|||
|
Quote:
I lol'd and yeah, the examples must be pretty bad considering that everything I've looked at has told the basics including the comment at the very start...
__________________
lol@sigs |
|
#10
|
||||
|
||||
|
I understand the // now
it's just a comment, nothing else. lol. I thought it has something to do with the codes
__________________
![]() IM PROUD TO BE A MEMBER OF PSP HACKS FORUMS
|
![]() |
|
|
|||
|
|||
|
|
| Thread Tools | |
| Display Modes | |
|
|