Help a noob?
Moderator: Coders of Rage
Help a noob?
Hey everyone so i LITERALLY just starting learning C++ today. i have this book called "C++ Programming for the Absolute Beginner, Second Edition". It is decent. but still a bit confusing. Anywho, just wondering on some tips to learning c++? i know it takes alot of hours, which i have now that i am unemployed as of this past friday haha... and ive been probabaly around 8 hours learning C++ and so far i made a dos window as me my name, ask me for 2 numbers and then give me the sum of those 2 numbesr. which took me about 40 mins to figure out haha... my brain hurts. how did most of you learn C++? any advice would be awesome
Re: Help a noob?
pick some tutorials, either a website or a book, and start following through the tutorials.
most of the time this gives you the basics of what you need to make simple applications by the end of it.
most of the time this gives you the basics of what you need to make simple applications by the end of it.
Re: Help a noob?
yea the book i have has some little "projects" like the one i mentioned. but il definately keep that inmind when i get futher into the book. i also orderd anohter book a few days ago. its suppost to be really good for beginners. thanks for the info
Re: Help a noob?
You have to bare in mind that the author won't expect you to understand everything in each illustration before moving onto the next.
Here is what a lot of books start off with.
It will probably explain that the "main" is where the program begins and the program is put inside the curly braces, it might tell you about the return value seeing as main is a integer. I doubt it will go much further.
This probably won't get explained.
This line right here includes both operators and namespaces, but I can almost promise that won't get explained
Overall what I'm trying to say is don't panic if you're not understanding everything. Learn the simple bits and build on top of that, and then you can go back a few pages and think "Oh I understand that now!".
Here is what a lot of books start off with.
Code: Select all
#include <iostream>
int main(int argc,char *args[]) {
std::cout << "Hello World" << std::endl;
return 0;
}
This probably won't get explained.
Code: Select all
int argc,char *args[]
Code: Select all
std::cout << "Hello World" << std::endl;
- Ginto8
- ES Beta Backer
- Posts: 1064
- Joined: Tue Jan 06, 2009 4:12 pm
- Programming Language of Choice: C/C++, Java
Re: Help a noob?
I'm pretty sure most beginner hello worlds wouldn't have console parameters, ie they'd just have:
Code: Select all
int main() {
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: Help a noob?
Also when I first started I remember that mysterious line "using namespace std;" appearing in EVERY tutorial but nobody would tell me what the hell it meant. It makes input / output commands much easier to demonstrate (by omitting the namespace specifier) to newbies.Ginto8 wrote:I'm pretty sure most beginner hello worlds wouldn't have console parameters, ie they'd just have:Code: Select all
int main() {
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
Re: Help a noob?
some of that stuff sounds familiar haha. thansk for the info guys. really appreciate it haha. i have a feeling im gonna be using strings ALOT haha. and storing strings. yayyyyy hahahah
-
- Chaos Rift Regular
- Posts: 101
- Joined: Thu Dec 09, 2010 2:13 am
Re: Help a noob?
To learn c++, I actually started with Game Maker when I was 14. If you actually apply their scripting language, GML it's very similar in syntax to c++ and teaches you core programming concepts, while making it easy for a beginner. Also, it allows you to start doing more than creating console apps, which can be terribly boring and discouraging for a beginner. Once you can make just about anything one could ask of you, then move onto your c++ book. It'll come together so easily once you have experience.
However, I highly recommend you don't get stuck in game maker hell and move onto a full programming language eventually, applying what you learned.
Google "Yoyo games Game Maker" for more details.
But, for strictly learning c++ I bought Sam's Teach yourself c++ in 21 days, a very nice book, and then learned SDL through lazyfoo's tutorials.
However, I highly recommend you don't get stuck in game maker hell and move onto a full programming language eventually, applying what you learned.
Google "Yoyo games Game Maker" for more details.
But, for strictly learning c++ I bought Sam's Teach yourself c++ in 21 days, a very nice book, and then learned SDL through lazyfoo's tutorials.
Re: Help a noob?
haha like80ninjas i love your video because your bakround if of my tattoo and my avatar haha. oroborus FTW! hahah and i was JUST having this convo with my cousin about my backround in RPG maker and Private Ragnarok Online servers i use to make. ive always been the type to mess around wtih computers so im hoping having that little backround will make my C++ learning experience a bit easier. il check those books out though. thanks for the advice and im hoping to learn c++ in a few months. im pretty decent at figuring out my problems so i have a decent problem solving thinking mentality and i know i can spend hours on end learning this stuff because i just spend 8 hours straight yesterday learning some c++ haha...like80ninjas wrote:To learn c++, I actually started with Game Maker when I was 14. If you actually apply their scripting language, GML it's very similar in syntax to c++ and teaches you core programming concepts, while making it easy for a beginner. Also, it allows you to start doing more than creating console apps, which can be terribly boring and discouraging for a beginner. Once you can make just about anything one could ask of you, then move onto your c++ book. It'll come together so easily once you have experience.
However, I highly recommend you don't get stuck in game maker hell and move onto a full programming language eventually, applying what you learned.
Google "Yoyo games Game Maker" for more details.
But, for strictly learning c++ I bought Sam's Teach yourself c++ in 21 days, a very nice book, and then learned SDL through lazyfoo's tutorials.
- GroundUpEngine
- Chaos Rift Devotee
- Posts: 835
- Joined: Sun Nov 08, 2009 2:01 pm
- Current Project: mixture
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++
- Location: UK
Re: Help a noob?
Sounds goodOdifma wrote:im pretty decent at figuring out my problems so i have a decent problem solving thinking mentality and i know i can spend hours on end learning this stuff because i just spend 8 hours straight yesterday learning some c++ haha...
Re: Help a noob?
ok... stupid noob question time... so im getting the hang of most of this stuff. the iomanip and iostream blah blah. but the part im kinda confused on is the (ios::showpoint, ios::fixed, ios::scientific, and ios::right) i have this book that gives hte meanings for each but its sort of brief, heres an example, "ios::showpoint - display decimal point with trailing zeros" now does that mean if i put ios::showpoint it will turn out like this "345.000000? because i thought that double allows decimal places to be shown? and what does it mean when it says it resets "flags" obviously its not literal flags that wave in my dos command window haha but i mean like in laymen terms what does most of that mean? because some oft he stuff most these guides talk about are things i dont really know yet so it kind of confuses me when they say "resets flags" blah blah blah
-
- Respected Programmer
- Posts: 387
- Joined: Fri Dec 19, 2008 3:33 pm
- Location: Dallas
- Contact:
Re: Help a noob?
These are all "text formatting" flags, hinted by the "ios::" part of it, which is short for "input/output stream" or "i/o stream" for short. These flags are only concerned with how data submitted to the output stream appear on the console. They do not affect the actual data itself, just how it is displayed.
What showpoint does is for whole numbers (numbers with no fractional component) it adds the decimal and trailing zeroes up to the precision limit you've set via ios::precision or what have you. If you do not have showpoint, whole number floats will not contain the decimal or any trailing zeroes, but will still display the fractional component for floats that DO have fractional components regardless.
All of the text formatting flags that you set, such as showpoint, can be "reset" to their original and default state. This is useful to return the i/o stream to it's default behaviour. ios::fixed, ios::scientific, ios::right are all also text formatting flags. When you set them yourself, they are not automatically reset until you explicitly reset them.
Displays
What showpoint does is for whole numbers (numbers with no fractional component) it adds the decimal and trailing zeroes up to the precision limit you've set via ios::precision or what have you. If you do not have showpoint, whole number floats will not contain the decimal or any trailing zeroes, but will still display the fractional component for floats that DO have fractional components regardless.
All of the text formatting flags that you set, such as showpoint, can be "reset" to their original and default state. This is useful to return the i/o stream to it's default behaviour. ios::fixed, ios::scientific, ios::right are all also text formatting flags. When you set them yourself, they are not automatically reset until you explicitly reset them.
Code: Select all
float a = 1.0f;
float b = 1.54696f;
std::cout << std::showpoint << a << std::endl;
std::cout << std::noshowpoint << a << std::endl;
std::cout << std::noshowpoint << b << std::endl;
Displays
Code: Select all
1.0
1
1.54696
Re: Help a noob?
gah... all of this is confusing... i realllly want to just stop learning c++... i dont seem smart enough to learn it all....
-
- Respected Programmer
- Posts: 387
- Joined: Fri Dec 19, 2008 3:33 pm
- Location: Dallas
- Contact:
Re: Help a noob?
Come on now. You said you were good at solving probs. Dont give up at the first resistance. Its a series of hurdles that never stop coming. Just stick with it.
"
"
Re: Help a noob?
im not givin up just yet haha.. its just gah. i guess its cause im trying to hard to absorb it all and so fast... i just need a break haha.. probably gona re-read what i dont get... hopefully il get it. just learning all the terms, and what they do, and why u have to have them, and where they go. alot to take in haha