Making Statment valid

Hi Everyone…

Let us suppose we have following code

int main ()

{

int x = x++;

}

currently this statement will cause undefined behavior. So what should we do with it, i mean to add something before it to make it valid….So here is small solution…

int x=1;

int main ()

{

int x = x++;

}

Defining global variable with same name is one of the solution…

Keep smiling

Advertisements
Posted in General. Tags: . Leave a Comment »

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: