"Linux C Programming One-stop learning" read notes

Source: Internet
Author: User

Introduction to the C language

$? is a special variable in the shell that represents the exit state of the previous command.

Incremental development: Write some code to compile and run, no problem to write the following.

To add the-G option at compile time, the resulting executable file can be debugged using GDB for source-level debugging:

The purpose of the Gcc-g main.c-o main-g option is to include source code information in the executable, such as the number of machine directives corresponding to the first few lines of source code. However, the source code is not embedded, so the source code can still be found when debugging with GDB.

GDB provides shell-like environments, common commands: List, start, Next, step (s), BackTrace (BT, view frame stack for function calls), info (view values of function local variables), print, Display (each time you stop to show the value of the specified variable, cancel the trace with Undisplay), break (abbreviated to B, the number of lines of code can be followed by the function name, you can also set a breakpoint to activate when a condition is met), delete breakpoints, disable breakpoints, enable (these three commands all add breakpoint number), info breakpoints (see which breakpoints are set), continue (abbreviated to C, run continuously until breakpoint), watch set observation point (watchpoints), X (Prints the value of the specified storage location, in bytes rather than variables),

Use assertions, assert,assert.h.

Depth-first search (usually using stacks), breadth-first search (using queues).

The essence of C language

"Linux C Programming One-stop learning" read notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.