Presentation is loading. Please wait.

Presentation is loading. Please wait.

Guidelines for working with Microsoft Visual Studio.Net.

Similar presentations


Presentation on theme: "Guidelines for working with Microsoft Visual Studio.Net."— Presentation transcript:

1 Guidelines for working with Microsoft Visual Studio.Net

2 Create a new Project

3 Select Project Type

4 Create a New File

5 Select File Type

6 Save the File

7

8 Add File to Project

9 Write the Code

10 Stage 2: Compile

11 Create Executable File

12 Stage 3: Execute

13 Output Window

14 Inserting a breakpoint Press right mouse button and select “Insert Breakpoint”

15 Start Debugging

16 Stopping at a Breakpoint Place the mouse on the variable of interest and check its value

17 Debug Windows Choose the window that will show the variables of interest

18 Stepping Over “Step over” and check the values in the “Watch” window

19 Run to Cursor “Run to cursor” will run till the current cursor position

20 Checking a value of a variable

21 Choose “Add Watch” to a variable to the “Watch” window

22 Factorial #include int main(void) { int i,n, fact=1; printf("Enter a number: "); scanf("%d", &n); for (i =1; i<=n; i++){ fact*=i; } printf ("\nThe functorial is: %d\n", fact); return 0; }

23 Stepping through a Loop

24 Errors Syntax errors – caught by compiler Run-time errors - seen during program execution. Reasons for run-time errors: –Infinite loops –Division by zero –Many more … Important Termination Commands: –Unix: -C –MS-DOS: -C or -break

25 Code and Compilation Examples

26 Printing Numbers #include int main(void) { int i; for(i=0; i<100; i++){ printf("%d\n", i); } return 0; }

27 Printing Numbers #include int main(void){ int i,j; for(i=0; i<20; i++){ for(j=0;j<20;j++){ printf("%d ", i); } printf("\n"); } return 0; }

28 Compilation Errors Example

29 Run Time Error Example Don’t try this at home!!!

30 Infinite Loop Don’t try this at home!!! Use C to terminate the execution


Download ppt "Guidelines for working with Microsoft Visual Studio.Net."

Similar presentations


Ads by Google