Dev C%2b%2b Pause Console

In our tutorial we write source files or make console application which show in console window, Because first we want to know the C programming language completely and then we proceed to make useful applications. In this tutorial we try to output text or any information in console a window.

The four most commonly used function modules of chrome developer tools are: elements, console, sources and network.

  • Elements: used to view or modify the properties of HTML elements, CSS properties, listening events, breakpoints, etc. CSS can be modified and displayed in real time. Greatly convenient for developers to debug the page
  • Console: the console is generally used to execute one-time code, view JavaScript objects, and view debug log information or exception information. It can also be viewed as a JavaScript API. For example, if I want to see the methods and properties of the console, I can directly enter “console” in the console and execute it
  • Source code: this page is used to view the HTML file source code, javascript source code and CSS source code of the page. In addition, the most important thing is that you can debug javascript source code and add breakpoints to JS code.
  • Network: network page is mainly used to view header and other information related to network connection.

1. Elements:

This part mainly displays the real-time DOM tree. Right click “review elements” in the page, and the elements panel will appear.

To view the code of an element:Click the arrow icon in the upper left corner (or press the shortcut key Ctrl + Shift + C) to enter the element selection mode, and then select the element you want to view from the page, and then you can locate the specific location of the element source code in the developer tool elements column

To view the attributes of an element:After locating the source code of the element, you can read out the attributes of the modified element from the source code. As shown in the figure below, the values of class, SRC, width and other attributes.

Right click on a DOM node and a menu will appear, which is divided into four parts

  • The first part is to add and edit the attributes of the node, such as class.
  • The second part is the edit node. Click edit as HTML to write code just like in the editor. Copy as HTML is to copy the code, and delete node is to delete the whole node.
  • The third part is to add DOM breakpoints (add breakpoints to elements)

If we check any one, DOM breakpoints will appear in the fifth part of the right column. This page can see all the element breakpoints of the current page. When the element is modified (usually JS code is modified), if the corresponding event (node subtree change, node attribute change, node removed) appears, the page loading will be suspended, and JS will hang in the corresponding event listener function.

The bottom shows all ancestor elements of a current element. For example, in the figure above, the current element is body, and its ancestor element is HTML (which is also a parent element). If HTML has a parent element, the parent element of HTML will still be displayed (this example is a little special).

Now look at the right column.

There are six partsComputed StyleStylesMetricsPropertiesDOM BreakpointsEvent Listeners

  • Computed style displays the final style of the selected element. If show all is checked, all the style attributes of the element will be displayed. Computed style The attributes in style are all CSS attributes of the element after calculation, that is, the attributes used by the browser when rendering the page are read-only and cannot be modified in real time, so they are mainly used to view the final attribute value of the element. The calculation of attributes is automatically performed by the browser, which is an essential process for the browser to render the page.
  • In the second part, styles estimation is used most. All CSS rules acting on the selected element will be displayed here, including the style rules in the CSS file, as well as the styles of user stylesheet and user agent stylesheet. The styles are arranged according to the weight, with the top one having the highest weight and the bottom one having the lowest weight. Top element.style Is the embedded style of an element. User stylesheet is a user style, but generally no one will customize it. User agent stylesheet is the default style of browser, and CSS Reset is to delete this reset. The part of the background that is not gray is a modifiable style. Our modification of the style will be displayed on the page in real time, which saves the process of modifying the CSS file to modify a few pixels and then saving and refreshing. At the same time, some styles can be disabled and enabled. There is a mouse arrow icon in the title bar of styles. After clicking, pseudo class will appear, because in general, CSS rules of pseudo class will not appear.

2. Console

First, the figure above: I don’t know how many people have found that the information about Baidu recruitment on the baidu homepage of the browser development tool “console” is as follows:

Console panel is often used for debugging
API function:
The core object of the console is console. If I want to see the methods and properties of the console, I can directly enter “console” in the console and execute it; or use the“ console.dir (console) “, you can also view the methods and properties of the console object;

We can use console to debug JS code
When a function is not working well, the developer will first check whether the console reports an error. The console panel will generally print some error information, similar to the app log, which file can be located to help us locate the problem.

After the code is executed to line 161, if you want to print “result”, you can debug it in console. Enter the code: “alert (” result = + result); “enter to pop up the result;

Or enter the code“ console.log (“result =” + result); “direct printing of results is also acceptable, as shown in the figure below:

For some simple JS statements, you can directly enter them in the console to view the results

3. Sources panel:

Open the sources panel; directly set a breakpoint for a line of JS code.

After refreshing the page, the program will stop on the line where the breakpoint is set.

Dev C%2b%2b Pause Console

Then we can add our own debug code after the breakpoint line, such as the following:

Press the shortcut key Ctrl + s to save. If the panel turns red, it means that the save is effective

View variables directly during single step debugging:
1. Through the sources – Watch panel, set the variables you want to monitor here. With the single step debugging, the values of these monitored variables will be updated.

In the rightmost status bar, scope > local, you can see some information. Otime is the debugging information of breakpoint line 374

2. Print variables through console, except in code console.log In fact, you can print directly with console in the process of single step debugging, as shown in the following figure:

You can also directly put the mouse on the variable you want to view, and select it to see the variable value, as shown in the figure:

Or directly enter the variable name in the console, enter:

After setting the breakpoint, the following buttons are very useful. They appear at the top of the right column.

The first button (like the play button) is pause and start.

F8: shortcut to the last step
If we want to skip the current breakpoint and continue to execute JS, we can click this button. After clicking this button, the execution of JS will continue. If we encounter a breakpoint again in the next execution, we will pause at that breakpoint.
Second button:

F10: execute sentence by sentence to the next step
When the mouse hovers, an English step over next function call will appear, which can be understood as step-by-step execution or sentence by sentence execution. Click this button.
After clicking, you will find that the program goes into the next line, and the debugging will be carried out step by step

The up arrow is the return button. After clicking it, you will exit the currently executing function and reach the state where the function is finished. If it is in the global scope, you will exit debugging. The last button is to activate and de activate all the breakpoints. If the current breakpoint is activated, all the breakpoints will not work after clicking, and will resume after clicking again.
The common shortcut keys are as follows:
F8: shortcut to the last step
Disable breakpoint with Ctrl + F8
F10: execute sentence by sentence to the next step
F11: statement by statement debugging, that is, step-by-step debugging. It will jump into methods and expressions for statement by statement tracking debugging

Debugging tips:

1. Modify page elements directly
Select the element on the page, right-click “check”, and the developer tool window will be opened to display the source code of the currently selected element. You can double-click to modify it.
If there are many things to modify, you can collapse the elements and click Select, then right-click edit as HTML to modify.

2. Color picker
Select the element on the page, right-click “check”, and the developer tool window will be opened. In the styles window, click the small box on the right of color of a style (if there is no color, you can input it yourself, such as color:red ), the color picker will pop up. You can select a color on the color palette above, or you can select the “pen” icon to pick up the color of the elements on the page.

3. Find and locate files quickly
View the source code, move the mouse to the development tool window, press Ctrl + P, input the first few letters of the link address, and all the qualified addresses will be displayed automatically. Click to open. (sometimes the first time you open it is blank, you can click the link again.).

After opening, if it is JS content, you can directly interrupt the debugging above.

Hello Friends.......
This is our first tutorial ,Before start to learn you need a compiler like
1. Dev C++
2. Turbo C++
this compilers is the best in my knowledge , but my tutorial is compiled in 'Dev C++'.
so download Dev C++ compiler first (Click Here to Download this compiler :'http://downloads.sourceforge.net/project/dev-cpp/Binaries/Dev-C%2B%2B%204.9.9.2/devcpp-4.9.9.2_setup.exe?r=http%3A%2F%2Fwww.bloodshed.net%2Fdev%2Fdevcpp.html&ts=1329683828&use_mirror=space')
after completing download
Install it ,
then
Open Dev C++ by clicking on it's icon present at desktop ,
then
Click on file menu ,
then
Click on New ,
then
Click on Source File ,
then
Click on File Menu ,
then
Click on Save As ,
then
Type then name of your file as you like with the extension ' .cpp ' (Ex : Myname.cpp)
then
Click on Save button.
--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------
In our tutorial we write source files or make console application which show in console window , Because first we want to know the C++ programming language completely and then we proceed to make useful applications.
So start now....
In this tutorial we try to output text or any information in console a window.
In C++ almost every source file need a HEADER FILE ,
Every HEADER FILE start with ' # ' ,
and the meaning of ' # ' is ' to find ' (Ex : When we Find IMEI no. we include ' # ' before the code it means we find our proper IMEI no.)
In this source programme we need a HEADER FILE name ' Iostream ',
(We will describe The meaning of IOSTREAM in our next tutorial)
HEADER FILE is included in programme with a format that is
#include <header file>
So please type the following in your .cpp source file of the Dev C++ source window
#include <iostream>
then
press enter
then
type following
using namespace std;
(We will describe the use of ' USING NAMESPACE STD; ' in our next tutorial)
then
type following
int main(){}
This is the main syntax of our programme and here ' int ' is a keyword of integer type and the ' main() ' is a function, and we write our programming code between ' { code } ' here.
in c++ there are many keyword like
1. ' char ' ----- for character type
2. ' float ' ----- for float type
3. ' double ' ---- for decimal type
and many more i will describe about every keyword in our next tutorials.
' main() ' is define our programme's function type.
in c++ there are many function that will be describe about every keyword in our next tutorials.
after typing this ' int main(){} ' please click between this ' {} 'brackets and press enter key 2 or 4 times.
then
the syntax will look like this
int main(){
}
then
click on the following start typing the code
int main(){
CLICK HERE AND TYPE THE CODE
}
When we want to display something on a console window , we want to write this code in our C++ console programme
cout<<'Type something about yourself';
COUT :
The meaning of cout is CONSOLE OUTPUT.
<< :
'<< ' This less then signs are known as a output operator in c++ (In c++, we need many operator that will describe in next tutorial) .This operator is define that which information is want to be display.
' :
And finally we write information between this inverted commas that we want to display in console window .
And then add this sign ' ; '
in c++ every code line is ended by this sign , if you forgot to add this in single one code line , the compiler will display syntax error.
Now our programme is ready for run.
1. Click on Execute.
2. Click on Compile & Run
OR
Press F9 key.
Now you see that a console screen was flashed.
Because our programme will compile first and then run and after closed automatically
this works is done by computer automatically ,because we don't add any code to stop or stay our programme .
So add a line after ( ' cout<<'Type something about yourself'; ') this ,
system('pause');
for this code our programme will stay in computer screen.
after adding this code ' Press F9 ' again
Now you see your console programme on the display
also you will display an extra line with your information that is 'Press any key to continue..'
this line is display for the code,
system('pause');
Now close the console window and add
' n '
this at the end of your information(cout<<'Type something about yourselfn'; ) or type
cout<<endl;
Between this lines
cout<<'Type something about yourself';
HERE
system('pause');
and then Press F9 again and now you will see your programme in a new format ,where the 'Press any key to continue...' line display after your information.
In c++
' n ' and ' cout<<endl; '(endl=end line)
is used for line breaking ,and
' t ' is used for line spacing.
you can add more then one line breaking or line spacing code at one time
like :
1. cout<<'Hellonnn....';
2. cout<<'Worldttt.....';
3. cout<<endl;
cout<<endl;
.
.
.
each code ,break or space one line.
So our first programme will look like this..
#include <iostream>
using namespace std;
int main(){
cout<<'My Name is Palash Basakn';
system('pause');
}
Friends if you find here any mistake ,please tell me i will tray to improve it (My English is so week).
or if you dont understand please email me at : palashbas@gmail.com
i will send you the video tutorial for free.
Please visit TOMORROW.................thanks
-----------Palash Basak


Friends, Before start our 2nd tutorial we need an overview
of our first tutorial
.





  1. Write a programme where display your full address ,


Name :
Your name.

Street :
Street of your home

State : Your state name.

Pin / Zip :
Your post office code :










  1. Find the error of this source code .



#include (iostream)

int
main
() {

cout<<Hellot Friendn:

cout<<”endl“;

}






3.
What is the meaning of n ” ?



5.
What is the meaning
of
endl
“ ?



7.
int “ is a function T/F .



9.
To stop our
programme in desktop we need the
code ______________ .


10
We write our programme
code
between “ {
} “/ ”
( ) “ brakets.

2b 2b Apartments