Back | Reverse |

i need help about C++
Link | by child_of_extreme on 2005-07-20 02:16:17
How and When do you use these(int,functions,short)?
i'm so confused because everytime I make a program it always requires one of these and sometimes it asks for things that are beyond our lessons.
I'm just a beginner and right now we are making calendars out of C++ and I am having a hard time doing it.
Cna somebody help out?

i am the way to the city of woe, i am the way to the forsaken people, i am the way to eternal sorrow - Raven

Re: i need help about C++
Link | by gendou on 2005-07-20 10:23:54 (edited 2005-07-20 10:24:32)
int is the C++ keyword that denotes an integer datatype. you use this keyword when declaring a variable or casting an expression.

functions are blocks of code that can be exected as part of your program. functions do one "task" on a set of inputs and return some output. for example:
int input = 25;
int output;
output = square_root(input);


the above code block means, in english, "create an integer in memory called input who's value is 25. create an integer galled output. set the value of output to the square root of input."

short is just another data type. you can lookup the behavior of the datatypes online.


Re: i need help about C++
Link | by child_of_extreme on 2005-07-20 15:14:22
what if it is (unsigned int) how do you use it?

i am the way to the city of woe, i am the way to the forsaken people, i am the way to eternal sorrow - Raven

Re: i need help about C++
Link | by gendou on 2005-07-20 17:19:59
unsigned int is an integer that can only be positive. if you try to set it to a negative value, then print it, you will get a very large positive value. unsigned ints can be twice as big as regular ints, which is one reason they are useful.


Re: i need help about C++
Link | by child_of_extreme on 2005-07-21 16:51:50
what do i need in order to make a simple calendar?
I always have a fatal error when i try to build it.

i am the way to the city of woe, i am the way to the forsaken people, i am the way to eternal sorrow - Raven

Re: i need help about C++
Link | by gendou on 2005-07-21 17:02:06
if you are confused about compile errors, you can paste them here and i will help you out.


Back | Reverse |

Copyright 2000-2024 Gendou | Terms of Use | Page loaded in 0.0024 seconds at 2024-05-08 01:22:10