![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Hobbyist Programmer
|
i got my code to work now lol
// Hey Everyone
//Welcome:
//Counting from 0 to 10
#include <iostream>
using namespace std;
int main ()
{
// declare a variable
int i;
for(i= 0; i < 11; i++)
cout << i << endl;
}
/*this opens the comment:
this is the generated output:
0
1
2
3
4
5
6
7
8
9
10
/* this cloese comment |
|
|
|
|
#12 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 750
Rep Power: 3
![]() |
Assuming that you posted your entire file, your comment never actually ends. Mulit-line comments are closed by */ and whatever comes after them is not a comment.
|
|
|
|
|
#13 |
|
Hobbyist Programmer
|
i used the code any put my stuff in it thats all i did. after i typed the code out myself.
|
|
|
|
|
#14 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Why do you need to store the generated output in the source file?
|
|
|
|
|
#15 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
You need to pay close attention to your responses (Jimbo's for sure), and you need to hit the book a little more. Regardless of book titles, you are not going to learn C++ in 10 minutes or 24 hour or 21 days. You aren't even going to learn to use Dev-Cpp in 10 minutes or 24 hours, though you may finally, with a lot of help, be able to print a sequence of numbers. This is not to drano you, unduly. This is to let you know that if you perceive serious programming as akin to learning to get to the umpteenth level in some game, you have made a misjudgement.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
#16 |
|
Hobbyist Programmer
Join Date: Jan 2006
Location: UK
Posts: 214
Rep Power: 3
![]() |
last time i did a bit of C++ void main() worked fine :/
|
|
|
|
|
#17 |
|
Hobbyist Programmer
|
you have ot take void main and make it int main()
|
|
|
|
|
#18 | |
|
Hobbyist Programmer
Join Date: Jan 2006
Location: Menidi, Athens, Greece
Posts: 238
Rep Power: 3
![]() |
Quote:
As for your problem: The box opens, but closes after the program is terminated without you being able to see what happened. In that case, type "system("PAUSE");" before the return statement, or type "cin.get();". In the second case, the program will wait for a character input and it will leave the window open for you to see what happened. I recommend using the second method I said, because it's cross-platform. LAST THING: Please read your book with more attention. I'm sure it says all the thing I said above.
__________________
Project::Soulstorm (personal homepage) |
|
|
|
|
|
#19 | |
|
Hobbyist Programmer
Join Date: Jan 2006
Location: UK
Posts: 214
Rep Power: 3
![]() |
Quote:
just because some people on the board have an attitude problem doesnt mean you have to join the band wagon means you have to too. second of all you should consult your own research as there is nothing wrong with void main(), and to my knowledge hasnt been on studio .net since tuesday... last time i did some programming... check your books if u dont believe me. |
|
|
|
|
|
#20 | |
|
Programmer
Join Date: Feb 2006
Location: Columbus, OH
Posts: 84
Rep Power: 3
![]() |
Quote:
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|