You are on page 1of 7

Programming assignment 1.

1. Create a C++ console application in VS Community Edition.

a) Change its C++ language standard to C++17.


c) From the log in build window, find cl.exe and list parameters that are passed to it.

c) From the log in build window, find cl.exe and list parameters that are passed to it.
e) From log in the build window, find link.exe and list parameters that are passed to it.

f) From internet, find the meanings of every parameter/flag passed to link.exe.


2. Type "Developer Command Prompt" in search window in Windows. And open VS
Developer Command Prompt. Create the executable using manually invoking cl.exe and
then link.exe. Run the executable thus created to verify that the output is what you expect.

3. Write the code we discussed in "A day in variable's life" slide. Debug the code and use
immediate window (Debug -> Windows -> Immediate) to find the address of the variables
and verify from Memory windows the junk value and set values for each of the variables.

4) 4. Write following code in the app. It is an infinite loop. Put a break point inside of this
loop. When the breakpoint is hit, change the value of i using watch/quick-watch/locals/autos
windows such that it can break out of the loop.
int main()
{
int i = 10;
while (1) {
cout <<"Infinite loop ... you can't break me!" << endl;
if (i > 10)
break;
}
cout << endl;
cout << "You finally broke me!" << endl;
}
Ans :
5) 5. Write following code in your program. Put a conditional break point such that the
breakpoint is hit in the loop after 100 iterations.
int main()
{
for (int i = 0; i < 1000; i++) {
cout << i <<' ';
}
}
Ans :

9)

You might also like