November 2002
Beginner
432 pages
11h 44m
English
Keeping in mind that no string variables exist in C, declaring variables in C is about as simple as declaring them in Visual Basic. Consider the following section of a main() function:
main()
{
char initial;
mt age;
float amount;
This code declares three variables: initial, age, and amount. They hold three different types of data: a character, an integer, and a floating-point value. These variables are local to the function and cannot be used outside main(). (You can declare variables before main(), and those variables are known as global, but global variables are generally not recommended.)
C does not initialize variables to zero as Visual Basic does. The assignment statement works just as it does in Visual Basic. You can ...