Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Closed Thread
 
Thread Tools Display Modes
Old Mar 10th, 2006, 12:34 PM   #11
demon101
Hobbyist Programmer
 
demon101's Avatar
 
Join Date: Mar 2006
Location: westboro, ohio
Posts: 159
Rep Power: 0 demon101 is an unknown quantity at this point
Send a message via Yahoo to demon101
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
__________________
Demon101 Production's

Code Forums
demon101 is offline  
Old Mar 10th, 2006, 12:39 PM   #12
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 750
Rep Power: 3 Jimbo is on a distinguished road
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.
Jimbo is offline  
Old Mar 10th, 2006, 12:46 PM   #13
demon101
Hobbyist Programmer
 
demon101's Avatar
 
Join Date: Mar 2006
Location: westboro, ohio
Posts: 159
Rep Power: 0 demon101 is an unknown quantity at this point
Send a message via Yahoo to demon101
i used the code any put my stuff in it thats all i did. after i typed the code out myself.
__________________
Demon101 Production's

Code Forums
demon101 is offline  
Old Mar 10th, 2006, 1:03 PM   #14
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Why do you need to store the generated output in the source file?
__________________
Me :: You :: Them
Ooble is offline  
Old Mar 10th, 2006, 1:07 PM   #15
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline  
Old Mar 10th, 2006, 1:21 PM   #16
Seif
Hobbyist Programmer
 
Seif's Avatar
 
Join Date: Jan 2006
Location: UK
Posts: 214
Rep Power: 3 Seif is on a distinguished road
last time i did a bit of C++ void main() worked fine :/
Seif is offline  
Old Mar 10th, 2006, 1:26 PM   #17
demon101
Hobbyist Programmer
 
demon101's Avatar
 
Join Date: Mar 2006
Location: westboro, ohio
Posts: 159
Rep Power: 0 demon101 is an unknown quantity at this point
Send a message via Yahoo to demon101
you have ot take void main and make it int main()
__________________
Demon101 Production's

Code Forums
demon101 is offline  
Old Mar 10th, 2006, 2:41 PM   #18
Soulstorm
Hobbyist Programmer
 
Soulstorm's Avatar
 
Join Date: Jan 2006
Location: Menidi, Athens, Greece
Posts: 238
Rep Power: 3 Soulstorm is on a distinguished road
Quote:
Originally Posted by demon101
yes i am. it isnt bring no box up for my to do the counting thing.
first of all, I must say that this is not a gaming forum. Please, when you have something to say, or a question to ask, do so in a respectful manner, and write specifically what is your problem, in plain and clear english. In most cases I believe you don't express yourself the right way, and no one can help you. Although I know the gaming language, most of the people here don't because they are no gamers, and they do not ought to be.

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)
Soulstorm is offline  
Old Mar 10th, 2006, 11:17 PM   #19
Seif
Hobbyist Programmer
 
Seif's Avatar
 
Join Date: Jan 2006
Location: UK
Posts: 214
Rep Power: 3 Seif is on a distinguished road
Quote:
Originally Posted by Soulstorm
first of all, I must say that this is not a gaming forum.
yeah first of all, you need to think about your own advice, and your responses as this is not a gaming forum, nor is it an "im superior to you" forum. just because some people may not speak the english as good as you means u can insult them... especially when your english isnt too shit hot yourself.

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.
Seif is offline  
Old Mar 11th, 2006, 1:26 AM   #20
jaeusm
Programmer
 
jaeusm's Avatar
 
Join Date: Feb 2006
Location: Columbus, OH
Posts: 84
Rep Power: 3 jaeusm is on a distinguished road
Quote:
just because some people may not speak the english as good as you means u can insult them
This is a good example of why grammar is important. You just gave me permission to insult you. However, if you expect well thought-out responses to your posts, I don't think it would hurt to do some proofreading. Well written grammar eliminates ambiguity.
jaeusm is offline  
Closed Thread

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:16 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC