inherit
139970
0
Dec 31, 2013 3:41:16 GMT -8
Luke
Rawhhh =D
1,780
April 2009
harry12345
|
Post by Luke on Mar 4, 2010 21:42:28 GMT -8
Can anyone, 'Cause the internet doesn't have much in the way which I've learnt. I've learnt the printf and scanf but on the internet it doesn't teach you that...
|
|
inherit
152434
0
Mar 4, 2010 23:18:35 GMT -8
debrah
1
March 2010
debrah
|
Post by debrah on Mar 4, 2010 23:18:34 GMT -8
|
|
inherit
77753
0
Jul 18, 2024 12:23:50 GMT -8
Bob
2,623
April 2006
bobbyhensley
|
Post by Bob on Mar 5, 2010 11:11:42 GMT -8
Can anyone, 'Cause the internet doesn't have much in the way which I've learnt. I've learnt the printf and scanf but on the internet it doesn't teach you that... Doesn't teach you what exactly? When it comes to C++ and its standard libraries I promise you it's covered and explained somewhere, you just need to take a few minutes to look through Google to find it. Besides Debrah's link there's a list of resources listed in the Useful Links thread. CProgramming.com and CPlusPlus.com being the two sites I'd recommend most.
|
|
inherit
128557
0
Dec 26, 2022 20:09:25 GMT -8
Rick Ace
4,691
July 2008
jacky10
|
Post by Rick Ace on Mar 5, 2010 15:32:07 GMT -8
C++ is quite complex, and some actually take classes. Where I live, it shouldn't be a problem finding a place that holds these classes. Of course, age can be a issue. Well, you can learn online, but beware it's complex.
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Mar 5, 2010 18:24:12 GMT -8
I'm taking my second course in C++ at university and I can tell you that there's quite a lot to learn, but if you spend a lot of time reading and experimenting you can get it. Make sure you get a firm understanding of pointers because they are extremely important. I recommend buying a book if you want to get serious about learning the language because that's what I did before I went to university and it gave me a huge head start. Feel free to send me a private message if you need help with something.
|
|
inherit
139970
0
Dec 31, 2013 3:41:16 GMT -8
Luke
Rawhhh =D
1,780
April 2009
harry12345
|
Post by Luke on Mar 5, 2010 20:46:29 GMT -8
I'm taking my second course in C++ at university and I can tell you that there's quite a lot to learn, but if you spend a lot of time reading and experimenting you can get it. Make sure you get a firm understanding of pointers because they are extremely important. I recommend buying a book if you want to get serious about learning the language because that's what I did before I went to university and it gave me a huge head start. Feel free to send me a private message if you need help with something. I have been given three books by my parents friend who is a master at it. It's in advanced though. I can make a basic calculator but I want to do more. Every Wednesday I get lessons, they started last week, and we get entered into a comp wither we like it or not and thats coming up soon so I'm wanting to learn in between the lessons but the tutorials on the internet are teaching me a differnet way to what my teacher is telling me. After learning printf and scanf what would I go onto next? If statments maybe?? Thanks to the others for the links and comments Debrah, thats currently what I'm trying to use to teach myself It's a good website
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Mar 5, 2010 21:29:26 GMT -8
Get all the basics down such as if statements, mathematical expressions, loops, functions, arrays, and knowing how to use cout and cin. I'm not listing them all, but just follow some tutorials and they should cover it all. Once you feel compfortable with the basics, try to make a simple game such as a text based RPG or Hangman. If you make an RPG, just have a function that prints a numbered menu such as the one below and then do something for each option. 1. Leave your swamp. 2. Fight some knights. 3. Rescue the princess. 4. Marry her. 5. Exit
Enter a number: Another easy game that will help you get used to programming is "Guess the number". Just generate a random number, and then every time the user enters their guess tell them "too high" or "too low" until they figure out the number. Just be sure to play around with loops and if statements for a bit before you do a game.
|
|
inherit
139970
0
Dec 31, 2013 3:41:16 GMT -8
Luke
Rawhhh =D
1,780
April 2009
harry12345
|
Post by Luke on Mar 6, 2010 20:38:08 GMT -8
Thanks, I'll work on that tonight and then post back what I end up with
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Mar 6, 2010 21:12:14 GMT -8
No problem, and good luck. Let me know if you need help.
|
|
inherit
139970
0
Dec 31, 2013 3:41:16 GMT -8
Luke
Rawhhh =D
1,780
April 2009
harry12345
|
Post by Luke on Mar 7, 2010 19:00:45 GMT -8
Thanks Jordan
|
|
inherit
139970
0
Dec 31, 2013 3:41:16 GMT -8
Luke
Rawhhh =D
1,780
April 2009
harry12345
|
Post by Luke on Mar 12, 2010 19:22:31 GMT -8
This is what I've done so far and it works
#include <cstdio>
int menu, num1, num2,total;
int main(){ printf("Enter two numbers:\n"); scanf("%d",&num1); scanf("%d",&num2); printf("Please choose an option\n1. Add\n2. Subtract\n3. Multiply\n4. Divide\n"); scanf("%d", &menu); if(menu==1){ total=num1+num2; printf("Total=\n%d",total); } if(menu==2){ total=num1-num2; printf("Total=\n%d",total); } if(menu==3){ total=num1*num2; printf("Total=\n%d",total); } if(menu==4){ total=num1/num2; printf("Total=\n%d",total); } if(menu>4){ printf("Please Try Again And Enter A Number Between 1 And 4!!!\n"); } return 0; }
I'm going to try loops hopefully now!
|
|
inherit
100824
0
May 13, 2012 5:37:49 GMT -8
Michael
14,585
March 2007
wrighty
|
Post by Michael on Mar 13, 2010 6:07:41 GMT -8
I could have sworn that c++ uses cout ... not printf ... Hmm ... could just be me ... looks more like C that does! :/ Aww well ... yea, I'm in the process (term used very loosely) of teaching myself C++...
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Mar 13, 2010 11:19:37 GMT -8
Yeah, you should use cin and cout instead. It's safer and makes things a lot easier because it has overloaded insertion and extraction operators (<< & >>) so it will automatically detect if the content is an integer, string, char etc.
cout << "Enter two number:" << endl; cin >> num1 >> num2; cout << "Please choose an option\n1. Add\n2. Subtract\n3. Multiply\n4. Divide\n"; cin >> menu;
|
|
inherit
139970
0
Dec 31, 2013 3:41:16 GMT -8
Luke
Rawhhh =D
1,780
April 2009
harry12345
|
Post by Luke on Mar 13, 2010 20:25:09 GMT -8
Yeah the person who taught me seems to do it that way :/ Umm can you give me an eg of a loop?
|
|
progon
New Member
Banned
Posts: 115
inherit
Banned
136832
0
Mar 19, 2010 23:44:58 GMT -8
progon
115
January 2009
progon
|
Post by progon on Mar 15, 2010 7:36:41 GMT -8
In all fairness, you're asking for us to hold your hand, I feel....
Loops are easy, you can do them using for(), while(), etc.
|
|