Difference Between The Lines

Page 1 of 1

1 Replies - 1114 Views - Last Post: 23 January 2008 - 08:41 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=41596&amp;s=a8835cf9df620f849d3c615e8aeb9d76&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

#1 soccerizzy26

Reputation: 0
• Posts: 69
• Joined: 23-January 08

Difference Between The Lines

Posted 23 January 2008 - 07:01 PM

This is my first post and I understand that this website isn't here to do my homework but I'm taking my class online and do not have a teacher in person who I can ask questions so I'm hoping someone on here can help me.

One of the questions for my assignment is to explain each line given to me and explain the difference between each line. I'm going to print out the lines then my explaination of each and their differences and if you find anything wrong or something I left out if you told me that'd be great.

a. int x;
b. int x = 3;
c. x = 3;

I believe line a x is an int variable and the value has not been declared yet
In line b the x is still an int variable but the value has been declared and it is equal to 3
In line c the type of variable isnt declared but it would be called x and equal to 3

The difference between the lines is that a is missing a value, line b is complete, and c is missing the type of variable

Is This A Good Question/Topic? 0

Replies To: Difference Between The Lines

#2 Tom9729

• Segmentation fault

Reputation: 181
• Posts: 2,642
• Joined: 30-December 07

Re: Difference Between The Lines

Posted 23 January 2008 - 08:41 PM

IIRC "declaring" a variable is when you say int x;, definining it is when you give it a value. Other than that, it all looks fine (as long as you know that all of those are valid in certain situations).