Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Why we must initialize a variable before using it? [closed]
- int count = 0;
- while(count < 500)
- {
- doFunction();
- count ++;
- }
- ...
- void doFunction() {
- count = sizeof(someString);
- print(count);
- }
- int i = 0;
- int j = foo();
- struct Foo { int i; int j; }
- struct Foo f = {0};
- int i ; // uninitialised variable
- i = some_function() ; // variable is "used" in left of assignment expression.
- some_other_function( i ) ; // value of variable is used
Add Comment
Please, Sign In to add comment