Can someone help me with my C++

Started by
11 comments, last by EvilJosh 22 years, 6 months ago
okay I re-started programing and I need some help with the int example. ( int long MyAge = 14 ) what is the LONG part and what does it mean...? I''m not just talking about LONG but all of them like int short... could one of you please help --- The EvilOne ---
--- The EvilOne ---
Advertisement
If you look in your local MSDN library you''d find a list of all of them


Base type Default sign Description
boolean unsigned 8-bit data item
byte - (not applicable) 8-bit data item
char unsigned 8-bit unsigned data item
double - 64-bit floating-point number
float - 32-bit floating-point number
handle_t - Primitive handle type
hyper signed 64-bit signed integer
int signed 32-bit signed integer
long signed 32-bit signed integer
short signed 16-bit signed integer
small signed 8-bit signed integer
void * - 32-bit context handle pointer type
wchar_t unsigned 16-bit unsigned data item


[type-specifier] [ signed | unsigned ] type-modifier [ type ] declarator-list;

type-specifier
Specifies a base_type, struct, union, enum type, or type identifier. An optional storage specification can precede type-specifier.

type-modifier
Specifies the keyword small, short, long, or hyper, which selects the size of the integer data. On 16-bit platforms, the size qualifier must be present.

declarator-list
Specifies one or more standard C declarators, such as identifiers, pointer declarators, and array declarators. (Function declarators and bit-field declarations are not allowed in structures that are transmitted in remote procedure calls. These declarators are allowed in structures that are not transmitted.) Separate multiple declarators with commas.
Examples
Huh... oh I see..
Ummm im at school so I don''t have the thing but when I get home ill look at it. I dont understand all that suff anyway
--- The EvilOne ---
Ummm could anyone else try to help me out with what im tring to do please anyone...... thanks for the help BTW )))))
--- The EvilOne ---
boolean - used for data that can be true or false
ex: bool Done = false;

BYTE - (see unsigned char)

char - holds whole numbers between -128 and 127 (usually for ASCII character codes)
ex: MyHealth = 32;

unsigned char - holds whole numbers between 0 and 255
ex: char MyAge = 192;

double - holds VERY accurate numbers with decimals
ex: double MyInterest = 1.000040346736963;

float - holds accurate numbers with decimals
ex: float Pi = 3.14159; (note, it would be smarter to write it as 3.14159f so the compiler knows 3.14159 is a float to begin with)

int - holds whole numbers between -32768 and 32767
ex: MyScore = 2442;

long - holds whole numbers between -2147483648 and 2147483647
ex: YouScore = 5386994363;

short signed - (see int)
small signed - (see char)

Invader X
Invader''s Realm
Umm, I don''t mean to be mean or rude but if the is confising you, you should probably go get a book like "Teach yourself C programming in 21 days" (first C book I read, in more than 21 days). variable declaration is one of the easiest things in a language. If you are getting stuck there then that is a sign that you need more of a background before you should start asking for help.



Jason Mickela
ICQ : 873518
E-Mail: jmickela@sbcglobal.net
------------------------------
"Evil attacks from all sides
but the greatest evil attacks
from within." Me
------------------------------
"The paths of glory lead but to the grave." - Thomas GrayMy Stupid BlogMy Online Photo Gallery
quote:Original post by griffenjam
Umm, I don''t mean to be mean or rude but if the is confising you, you should probably go get a book like "Teach yourself C programming in 21 days...


I agree, but skip C and go straight to C++. The two languages require very different ways of thinking, and many (well-versed) C programmers never really learn to leverage C++ (anywhere near) fully.
I started with QBasic, then C, then C++. I believe that progressing the way I did gave me a foundation I wouldn''t have if I had just gone straight to c++.

--Lowell N. Manners
lowell@makevideogames.com
MakeVideoGames.com
--Lowell N. Mannerslowell@makevideogames.comMakeVideoGames.com
yes but I don''t think you''ll ever become as good a C++ programmer as someone who started with C++ (assuming both of you are equally intelligent). That''s just the way programming works, your first language will always be your best and it will warp the way you see the world.
That''s not true at all. I started out like Lowell did with QBasic, or actual line number BASIC rather, and then learned C. After I was using C for over a year, I started learning C++. Right now, I''m using C++''s object oriented style to my advantage with my current game engine. Things like stl, polymorphism, factories, and other C++ concepts that are specific to the language. You can learn these things, but you just have to find a use for them first.

dave

--
david@neonstar.net
neonstar entertainment
--david@neonstar.netneonstar entertainment

This topic is closed to new replies.

Advertisement