how to to the debugging if someone is using notepad++ and cmd
Title
Question
how to to the debugging if someone is using notepad++ and cmd
C-and-Cpp First-C-Program 04-05 min 0-10 sec
Answers:
One option is to put a lot of print statements and check that every one of your commands is doing exactly what you expect.
sample program
----------------------
#include <iostream>
using namespace std;
int add(int a, int b)
{
int c = a + b;
cout<<"a"<<a<<"\n";
cout<<"b"<<b<<"\n";
cout<<"c"<<c<<"\n";
return c;
}
i nt main()
{
int sum;
sum=add(5,4);
cout<<"Sum is "<<sum<<"\n";
return 0;
}
in the above program I want to print a,b and c variable values to check the content of the variables
Login to add comment