answersLogoWhite

0


Best Answer

Initialization is when you assign a value to a variable at definition. For instance...

int i = 123;

Assignment is when you assign a value to a variable at a later time. For instance...

int i;

i = 123;

Sometimes, automatic initialization (to zero) can occur without the explicit = clause, such as for file scoped variables, or for variables allocated through a debug allocator, but it is in bad form to depend on such values.

I would fire a programmer that repeatedly fails to initialize variables, and I would flunk a student that does the same.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between initialization assignment of a variable in C programming explain withexample?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the difference between instantiation and initialization in C plus plus?

Instantiation is creating the instance of the variable/object . While Initialization is to provide the variable with some value. int i; // i is an instance of an integer i=10; //initialised with the value 10


Short note on structural programming and procedural programming?

There is no difference between procedural programing language & structure programing language.


What is the difference between Imperative object-oriented functional and logic programming?

These are all programming paradigms; they describe the "style" used to build the structure and elements of a computer program. Imperative programming is typically contrasted with declarative programming because they are mutually-exclusive (you won't find any programming languages that are both imperative and declarative), in the same way that you won't find any languages that have both a structured paradigm and a non-structured paradigm. The main difference between the two is that imperative programming describes how a result is to be achieved without specifying what is to be achieved, whereas declarative programming describes what is to be achieved without specifying how it is to be achieved. Another key difference is that imperative programming makes extensive use of changing-state and mutable data whereas declarative programming does not. Put simply, there are no assignment operations or side-effects in declarative programming. Given that the object-oriented programming (OOP) paradigm is based upon objects with member methods that can mutate the object's attributes, OOP is based upon the imperative paradigm. The functional programming paradigm is not to be confused with function calls which are based upon the procedural programming paradigm, which is itself based upon the structured programming paradigm, both of which are imperative. By "functional" we really mean mathematical functions, which are declarative. Although there are some imperative languages that do allow a type of functional programming style, at best they are a grey area because of the side-effects. Logical programming is also declarative and is based on relations.


What is the difference between unbalanced transportation and unbalanced assignment problem?

model sum


What is the difference between initialisation and definition in C programming?

Variable-declaration is: extern int x; extern double y; extern char a; Variable-definition is: int x; static double y; auto char a; Variable-definition with initialization is: int x = 1; static double y= 2.3; auto char a = 'w';

Related questions

What is the difference between string and char array?

3 differences.................. 1. length wise.... 2.initialization 3. null terminated length of char array is differ from string........ initialization of string is differ from char....... and string is null terminated...........


What is the difference between declaration and initialization?

Perhaps an example will help. extern int value; /* declaration */ int value; /* definition */ int value= 20; /* definition with initialization */


What is the difference between instantiation and initialization in C plus plus?

Instantiation is creating the instance of the variable/object . While Initialization is to provide the variable with some value. int i; // i is an instance of an integer i=10; //initialised with the value 10


What is the difference between java and object oriented programming?

java is a programming language/platform that embodies object oriented programming concepts. The question of what is the difference is like asking what is the difference between cars and a Volvo.


Difference between conventional programming and object oriented programming?

diff between oops and conventional programming


What is the difference between structured oriented programming procedure and oriented programming?

LOTTA


Difference between C and C programming language?

The C and C programming languages are one and the same. There is no difference between those languages.


For this assignment youll want to find at least one point of similarity and one point of difference between the two works?

The assignment would be a comparison/contrast assignment.


What are the difference between homework and assignment t?

An assignment is something you're assigned to do, homework is work that you do at home so therefore a homework assignment is work that you're assigned to do at home.


What is the difference between a equals equals 0 and a equals 0?

One equals is used in an equation which is true, such as 5 + 3 = 8 Equals equals is used in computer programming as a question as to whether 2 things are equal. Like If x == 4 perform this operation ... If you are referring to 'C' language programming: A single equal sign is an assignment, a double equal sign is a comparison. a = 7; /* An assignment. You are assigning the value of 7 to the variable called 'a' */ if (a == 7) /* A comparison. You are checking if the variable 'a' has the value of 7 */


What is the difference between online and offline programming?

Online programming is programming that has to occur while the computer or other device is connected to the internet. Offline programming doe not require an internet connection.


What is the difference between a Deed of Undertaking and a Deed of Assignment?

deed of undertaking