> /*I'm a newbie in C. Please help! */ Which one is the correct way to organize a variable in C programming?

/*I'm a newbie in C. Please help! */ Which one is the correct way to organize a variable in C programming?

Posted at: 2014-12-18 
Is it:-

a.) int random_number;

random_number = 666;

-or-

b.) int random_number = 666;

?

Either way will work, so there is no INcorrect way.

If the variable needs to be initialized to a certain value then use b.

If it will be set to a value later in the program (maybe a return value from a function) then

int random_number; .

...

random_number = rand();

would be best.

b

Is it:-

a.) int random_number;

random_number = 666;

-or-

b.) int random_number = 666;

?