| View previous topic :: View next topic |
| Author |
Message |
Cyrusmages Grandmaster Cheater Supreme
Reputation: 0
Joined: 22 Feb 2009 Posts: 1358
|
Posted: Sat Mar 28, 2009 8:33 pm Post subject: [C++] Trouble with a tutorial |
|
|
Well, I wanted to learn C++, the entire language, because as computers are rapidly becoming the present, and not the things of the future that they once more, I realize that knowing more about computers can help me out a lot.
I looked up tutorials on google, and the first link was this:
http://www.cplusplus.com/doc/tutorial/program_structure.html
Now, the tutorial looks really good and it seems really understandable, yet when I copy + Paste the code into my program (exactly as they have it), it says I have build errors.
Could you tell me of a better site or something that might help me with this website?
_________________
If you have a mic, add me and tell me that you're from CEF or I won't add you (probably) |
|
| Back to top |
|
 |
VolatileAce Cheater
Reputation: 0
Joined: 19 Mar 2009 Posts: 30 Location: 0001001100110111
|
Posted: Sat Mar 28, 2009 10:02 pm Post subject: |
|
|
| If you've never had programming experience base, try to get started with another language first, especially when your learning it by yourself. C++ is a bit advanced for a beginner. This is personal opinion so yea. (Pss go take Java)
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sat Mar 28, 2009 10:37 pm Post subject: |
|
|
| Post the error... can't read minds.
|
|
| Back to top |
|
 |
VolatileAce Cheater
Reputation: 0
Joined: 19 Mar 2009 Posts: 30 Location: 0001001100110111
|
Posted: Sun Mar 29, 2009 1:14 am Post subject: |
|
|
Again, Cyrusmages, I can't answer PMs so I'll do it here >_>
Just add this chuck of code before int main()
Edit the 40in line 4 to whatever number you want to cut to next line.
| Code: | void append(string s){
static int count = 0;
for(int i = -1; ++i < s.length(); cout << s.at(i))
if(count++ % 40 == 0 && count != 1)
cout << endl;
} |
And then in your code, whenever you do cout, change it to append, for example:
| Code: | | cout << "Hi my name is Bob." << endl; |
should be changed to | Code: | | append("Hi my name is Bob"); |
|
|
| Back to top |
|
 |
Cyrusmages Grandmaster Cheater Supreme
Reputation: 0
Joined: 22 Feb 2009 Posts: 1358
|
Posted: Sun Mar 29, 2009 7:26 am Post subject: |
|
|
| VolatileAce wrote: | Again, Cyrusmages, I can't answer PMs so I'll do it here >_>
Just add this chuck of code before int main()
Edit the 40in line 4 to whatever number you want to cut to next line.
| Code: | void append(string s){
static int count = 0;
for(int i = -1; ++i < s.length(); cout << s.at(i))
if(count++ % 40 == 0 && count != 1)
cout << endl;
} |
And then in your code, whenever you do cout, change it to append, for example:
| Code: | | cout << "Hi my name is Bob." << endl; |
should be changed to | Code: | | append("Hi my name is Bob"); |
|
I never PMed you on this XD
Eh, I'll just stick with another programming language. Just having someone give me the code teaches me pratically nothing. As you've suggested and as someone else suggested, I'll just learn Java first.
What's the best site you know with good tutorials for Beginner - Advanced?
_________________
If you have a mic, add me and tell me that you're from CEF or I won't add you (probably) |
|
| Back to top |
|
 |
VolatileAce Cheater
Reputation: 0
Joined: 19 Mar 2009 Posts: 30 Location: 0001001100110111
|
Posted: Sun Mar 29, 2009 11:23 am Post subject: |
|
|
| Cyrusmages wrote: | I never PMed you on this XD
Eh, I'll just stick with another programming language. Just having someone give me the code teaches me pratically nothing. As you've suggested and as someone else suggested, I'll just learn Java first.
What's the best site you know with good tutorials for Beginner - Advanced? |
| Quote: | From: Cyrusmages
To: VolatileAce
Posted: Sat Mar 28, 2009 9:45 am
Subject: Another question, lol Quote message
With that code, I put in thousands of IDs (FINGERS HURT) and I realized that 30 or 40 look messed up in the console because I add so much into it.
Is there a way to make it to where
Me
Console
Hi
Wassup
How're you?
You doing good?
Shut the fuck up
You got it, sir.
Sorry, sir.
You can fuck my wife, sir.
To where it doesn't roll over like this
Hi
Wassup How're you You doing go->Rollsovertonextline
od?
I tried a few things but I always ended up failing it or getting build errors. Please reply in the topic if you have any free time.
_________________
Xbox Live Gamertag: Cyrusthebeast
If you have a mic, add me and tell me that you're from CEF or I won't add you (probably) |
|
|
| Back to top |
|
 |
Cyrusmages Grandmaster Cheater Supreme
Reputation: 0
Joined: 22 Feb 2009 Posts: 1358
|
Posted: Sun Mar 29, 2009 11:30 am Post subject: |
|
|
That was for rolling over, not help with a tutorial, hence me saying "I didn't PM you on this.
_________________
If you have a mic, add me and tell me that you're from CEF or I won't add you (probably) |
|
| Back to top |
|
 |
VolatileAce Cheater
Reputation: 0
Joined: 19 Mar 2009 Posts: 30 Location: 0001001100110111
|
Posted: Sun Mar 29, 2009 12:42 pm Post subject: |
|
|
| java.sun. com/docs/books/tutorial/
|
|
| Back to top |
|
 |
Cyrusmages Grandmaster Cheater Supreme
Reputation: 0
Joined: 22 Feb 2009 Posts: 1358
|
Posted: Sun Mar 29, 2009 12:44 pm Post subject: |
|
|
| VolatileAce wrote: | | java.sun. com/docs/books/tutorial/ |
If I learn Java, will I be able to code stuff like my own games?
_________________
If you have a mic, add me and tell me that you're from CEF or I won't add you (probably) |
|
| Back to top |
|
 |
`unknown Grandmaster Cheater
Reputation: 0
Joined: 20 Nov 2006 Posts: 658 Location: You lost the game.
|
Posted: Sun Mar 29, 2009 1:20 pm Post subject: |
|
|
| Java has a weird syntax imo, but I guess overall it would be easier to learn. If your still confused on java try learning something like php, it will teach you the basic syntax for C++ (if-then-else, for(each)/while loops, functions, classes, etc.) and then you can take another shot at it.
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Sun Mar 29, 2009 1:57 pm Post subject: |
|
|
C first, then C++. You aren't even using the most key component of C++, which are classes, so stick to C for now.
_________________
|
|
| Back to top |
|
 |
rapion124 Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Mar 2007 Posts: 1095
|
Posted: Mon Mar 30, 2009 6:43 pm Post subject: |
|
|
| Instead of reading books, first understand how your compiler works. Then try to learn the language.
|
|
| Back to top |
|
 |
|