Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » Noob at C++, just looking for some beginner help.
Closed Thread
Old 08-26-2008, 10:35 PM   #1 (permalink)
 
Newb Techie

Join Date: Aug 2008

Posts: 13

MR2SUFI is on a distinguished road

Default Noob at C++, just looking for some beginner help.

I'm trying to learn some stuff in C++, ultimately be able to design things, such as games..etc.
I know that will be a LONG time from now, as there's already stuff I'm not understanding.
But just to get kick off the learning experience..I'm reading
a tutorial type thing online.

I've came across this part,

"n addition to decimal numbers (those that all of us are used to use every day) C++ allows the use as literal constants of octal numbers (base 8) and hexadecimal numbers (base 16). If we want to express an octal number we have to precede it with a 0 (zero character). And in order to express a hexadecimal number we have to precede it with the characters 0x (zero, x). For example, the following literal constants are all equivalent to each other:

75 // decimal
0113 // octal
0x4b // hexadecimal

All of these represent the same number: 75 (seventy-five) expressed as a base-10 numeral, octal numeral and hexadecimal numeral, respectively. "

I'm not understanding how..
0113 and 0x4b=75?
MR2SUFI is offline  
Old 08-26-2008, 10:55 PM   #2 (permalink)
 
Newb Techie

Join Date: Aug 2008

Posts: 16

george_1988 is on a distinguished road

Default Re: Noob at C++, just looking for some beginner help.

If your goal is to develop games then you're going to need a serious grasp for C++ or C to begin with.

Then you will need some Win32 API knowledge for basics like creating windows and such.

You will also need to learn a graphics library API such as DirectX or OpenGL.

To go along with that you're going to need to be competent with mathematics such as trigonometry.


I suggest getting some books and online tutorials and getting stuck into writing programs. Stick with it. That's the key!
george_1988 is offline  
Old 08-27-2008, 12:14 AM   #3 (permalink)
 
Newb Techie

Join Date: Aug 2008

Posts: 13

MR2SUFI is on a distinguished road

Default Re: Noob at C++, just looking for some beginner help.

:eek: I'm 16. and math is my weak subject!
Time to start reading I guess.
trigonometry sounds oh so fun.
MR2SUFI is offline  
Old 08-27-2008, 08:59 AM   #4 (permalink)
 
Software Developer

Join Date: Mar 2006

Location: Columbus, OH

Posts: 569

jaeusm is on a distinguished road

Default Re: Noob at C++, just looking for some beginner help.

Quote:
I'm not understanding how..
0113 and 0x4b=75?
Try here: Introduction to decimal, binary, hexadecimal, octal and converting between bases
jaeusm is offline  
Old 08-31-2008, 04:02 AM   #5 (permalink)
Baez's Avatar
 

Join Date: Sep 2005

Location: Toronto, Canada

Posts: 5,465

Baez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of light

Default Re: Noob at C++, just looking for some beginner help.

Basically Octal numbers can go up to 8 and Hex go up to 16.

So Decimal 7 = Octal 7, however a decimal value of 8 = an Octal value of 10. Add one to the next number and then keep going up again:

Decimal 9 = Octal 11
D 10 = O 12
D 16 = O 20
D 17 = O 21
D 24 = O 30
D 32 = O 40
D 40 = O 50
D 48 = O 60
D 56 = O 70
D 63 = O 77 - Once again the second number cannot pass 8 so you move to the third.
D 64 = O 100
D 72 = O 110
D 75 = O 113


For Hex take the 0x away first off. That's just there to let the C++ compiler know that you want the number to be used as a hex value.

D 1 = H 1
D 9 = H 9

As soon as the decimal goes to 10 hex switches to the letters A through F.

D 10 = H A
D 15 = H F

Then just use the same method for octal. Once the hex value can't go any higher for the first digit move to the second and add one.

D 16 = H 10
D 31 = H 1F
D 32 = H 20
D 48 = H 30
D 64 = H 40
D 73 = H 49
D 74 = H 4A
D 75 = H 4B

It is tough to explain but I hope that helps.
__________________


Last edited by Baez; 08-31-2008 at 04:13 AM.
Baez is offline  
Old 08-31-2008, 07:09 AM   #6 (permalink)
S0ULphIRE's Avatar
 
01001100011011110110110

Join Date: Mar 2007

Location: Perth, Australia

Posts: 1,940

S0ULphIRE has a spectacular aura aboutS0ULphIRE has a spectacular aura about

Send a message via MSN to S0ULphIRE
Default Re: Noob at C++, just looking for some beginner help.

I haven't met anyone who uses octal tho. hex yeah. use that a LOT, way easier to type things in hex than in a long string of binary.
__________________
"As a result of all this hardship, dirt, thirst, and wombats, you would expect Australians to be a dour lot. Instead, they are genial, jolly, cheerful, and always willing to share a kind word with a stranger, unless they are an American."
-- Douglas Adams

Click this if I helped you
>>>><<<<
S0ULphIRE is offline  
Old 09-07-2008, 02:46 PM   #7 (permalink)
 
Over and Above Person

Join Date: Jun 2008

Posts: 694

Ric0h is on a distinguished road

Send a message via MSN to Ric0h
Default Re: Noob at C++, just looking for some beginner help.

You guys are ruining math for me, this is too hard, even with the explanation I dont get it.
__________________
ANTEC 900: Gigabyte Ga-Ep35-DS3P : THERMALTAKE (700 watts) :
4 GB G.SKILL 1000 mhz Intel Quad Core (Q6600)
ATI 4870 ARTIC COOLER FAN
WD 640 and 22x DVD burner
Ric0h is offline  
Old 09-07-2008, 07:18 PM   #8 (permalink)
Baez's Avatar
 

Join Date: Sep 2005

Location: Toronto, Canada

Posts: 5,465

Baez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of light

Default Re: Noob at C++, just looking for some beginner help.

Really? I thought my explanation was pretty straight forward.
__________________

Baez is offline  
Old 09-07-2008, 08:55 PM   #9 (permalink)
S0ULphIRE's Avatar
 
01001100011011110110110

Join Date: Mar 2007

Location: Perth, Australia

Posts: 1,940

S0ULphIRE has a spectacular aura aboutS0ULphIRE has a spectacular aura about

Send a message via MSN to S0ULphIRE
Default Re: Noob at C++, just looking for some beginner help.

ok, try binary first then. There are only two possible values: 1 and 0. All you need to know is that 0+0=0, 0+1=1, and 1+1=10 (NOT ten, but One Zero) It's very important that you keep in mind that if you see 1000 in binary it's 'One Zero Zero Zero'.
so you'd count like this:
00 (0 decimal)
01 (1) ------ when I added 1 to 00 I got 01, (0+1=1)
10 (2) ------ when I added 1 to 01 I got 10, (1+1=10)
11 (3) ------ when I added 1 to 10 I got 11, (0+1=1)
100 (4) ------ when I added 1 to 11 I got 100, (1+1=10)

The last example maybe needs a bit more explaining. Taking the problem one digit at a time:
we added "1" to the first digit in "11". 1+1=10.
Now we have "0" where the first "1" used to be, and the "1" from our "10" answer is in the same place as the second "1" in "11" e.g. 1(1-on-top-of-other-1)0
With the two 1's in the same place, they need to be added. 1+1=10
So our final answer is 'OneZeroZero' or '100'
__________________
"As a result of all this hardship, dirt, thirst, and wombats, you would expect Australians to be a dour lot. Instead, they are genial, jolly, cheerful, and always willing to share a kind word with a stranger, unless they are an American."
-- Douglas Adams

Click this if I helped you
>>>><<<<
S0ULphIRE is offline  
 
Closed Thread

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Idoit noob mistake. eggcream Hardware Troubleshooting 10 06-17-2008 04:56 PM
Am i a noob or what? backup287 PC Gaming 5 03-06-2008 01:44 PM
another noob trying to OC :) sjm80 Overclocking, Case Mod, Tweaking PC Performance 10 11-12-2007 02:17 PM
Noob wants to loose (3rd party) XPpro + switch to Linux Jougukny Linux, BSD, other *nixes & Open Source Software 6 11-01-2007 02:45 AM