Guidelines for working with Microsoft Visual Studio 6.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Why care about debugging? How many of you have written a program that worked perfectly the first time? No one (including me!) writes a program that works.
BIM313 – Advanced Programming Techniques Debugging 1.
MT311 Tutorial Li Tak Sing( 李德成 ). Uploading your work You need to upload your work for tutorials and assignments at the following site:
Understanding Loops Using C Language Week 15 Mr.Omer Salih.
General Computer Science for Engineers CISC 106 Lecture 21 Dr. John Cavazos Computer and Information Sciences 04/10/2009.
CS201 - Repetition loops.
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
Finding and Debugging Errors
How to Debug VB .NET Code.
Guidelines for working with Microsoft Visual Studio.Net.
1 Gentle Introduction to Programming Tirgul 2: Scala “hands on” in the lab.
Testing a program Remove syntax and link errors: Look at compiler comments where errors occurred and check program around these lines Run time errors:
1 Agenda - Loops while for for & while Nested Loops do-while Misc. & Questions.
Debugging Logic Errors CPS120 Introduction to Computer Science Lecture 6.
Debugger Presented by 李明璋 2012/05/08. The Definition of Bug –Part of the code which would result in an error, fault or malfunctioning of the program.
Computer Science 210 Computer Organization Introduction to C.
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering.
Using a Debugger. SWC What is ”debugging”? An error in a computer program is often called a ”bug”… …so, to ”debug” is to find and get rid of errors in.
Debugging applications, using properties Jim Warren – COMPSCI 280 S Enterprise Software Development.
Debugging Projects Using C++.NET Click with the mouse button to control the flow of the presentation.
BİL528 – Bilgisayar Programlama II Making Decisions, Loops, Debugging, Designing Objects Using Classes 1.
Principles of Programming - NI July Chapter 5: Structured Programming In this chapter you will learn about: Sequential structure Selection structure.
CSEB 114: PRINCIPLE OF PROGRAMMING Chapter 5: Structured Programming.
CS1010E Programming Methodology Tutorial 3 Control Structures and Data Files C14,A15,D11,C08,C11,A02.
Our Environment We will exercise on Microsoft Visual C++ v.6 We will exercise on Microsoft Visual C++ v.6 because that is what we have in the univ. because.
Incremental operators Used as a short-hand i++ or ++i  ==  i = i + 1 i-- or --i  ==  i = i – 1 i += a  ==  i = i + a i -= a  ==  i = i - a i *=
Do-while loop Syntax do statement while (loop repetition condition)
Program Errors and Debugging Week 10, Thursday Lab.
VB – Debugging Tools Appendix D. Why do we need debugging? Every program has errors, and the process of finding these errors is debugging Types of errors.
1 C Programming Week 2 Variables, flow control and the Debugger.
CSE 232: C++ Programming in Visual Studio Graphical Development Environments for C++ Eclipse –Widely available open-source debugging environment Available.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Chapter 5: Structured Programming
Debugging Visual Basic.NET Programs ► ► Use debugging tools ► ► Set breakpoints and correct mistakes. ► ► Use a Watch and Local window to examine variables.
Debugging Xin Tong. GDB GNU Project debugger Allows you to see what is going on `inside' another program while it executes or crashed. (Faster than printing.
Bit-DSP-MicrocontrollerTMS320F2812 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH)
Functions Exercise 5. Functions a group of declarations and statements that is assigned a name  effectively, a named statement block  usually has a.
Introduction to Programming Lecture 7: Repeating Statements.
Hints on debugging
NETBEANS DEBUGGER.  To create a breakpoint place the cursor at the desired location.  Go to the Run -> toogle line Breakpoint or Ctrl +F8. It creates.
CS 177 Week 10 Recitation Slides 1 1 Debugging. Announcements 2 2.
Debug in Visual Studio Windows Development Fundamentals LESSON 2.5A.
5.01 Understand Different Types of Programming Errors
The Cast Operator The cast operator converts explicitly from one data type of an expression to another. For example, if x is of type int, the value of.
6. LOOPS. Example: Summing a Series of Numbers #include int main(void) { int n, sum = 0; printf("This program sums a series of numbers.\n"); printf("Enter.
1 More on Arrays. 2 Review: Passing Arrays to Functions Passing an array: what goes on in the memory? Why isn’t it the same as when passing primitives?
COMPUTER PROGRAMMING I SUMMER Understand Different Types of Programming Errors.
Arrays Name, Index, Address. Arrays – Declaration and Initialization int x; y[0] y[1] y[2]
Debuggers. Errors in Computer Code Errors in computer programs are commonly known as bugs. Three types of errors in computer programs –Syntax errors –Runtime.
Dr. Sajib Datta Sep 8,  char type technically is an integer type  Computer uses numeric codes to represent characters, and store characters.
ECE Application Programming
5.01 Understand Different Types of Programming Errors
Computer Science 210 Computer Organization
Testing and Debugging.
CS1010 Programming Methodology
Testing Key Revision Points.
Control Structures Lecture 7.
Computer Science 210 Computer Organization
INC 161 , CPE 100 Computer Programming
5.01 Understand Different Types of Programming Errors
Debuggers.
DEBUGGING JAVA PROGRAMS USING ECLIPSE DEBUGGER
Tonga Institute of Higher Education
Lab 1: Getting started ICE0125 Programming Fundamentals II – C/C++
Our Environment We will exercise on Microsoft Visual C++ v.6
Debugging Visual Basic Programs
Chapter 15 Debugging.
ICS103: Programming in C 5: Repetition and Loop Statements
Chapter 15 Debugging.
Presentation transcript:

Guidelines for working with Microsoft Visual Studio 6

Create a new Project

Select Project Type

Create New File

Write the Code

Stage 2: Compile

Create Executable File

Stage 3: Execute

Execution Window

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

Start Debugging

Stopping at a Breakpoint The “Watch” window will show the values of the variables

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

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

Checking a value of a variable

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

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; }

Stepping through a Loop

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

Compilation Errors Example

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

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

Code and Compilation Examples

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

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; }