Please enable JavaScript.
Coggle requires JavaScript to display documents.
C Programming Fundamentals - Coggle Diagram
C Programming Fundamentals
Introduction
C is a widely used programming language (system applications, microwaves etc), not destined to develop web sites (use PHP)
Install CodeBlocks (a free IDE to write and compile your code)
Setting up CodeBlocks
create a project
understand how to build and run a source code
build = translate the source code to binary numbers so the computer can understand
How Computer Programs Work
a program is made of
functions.
the job of a function is to tell the computer to do something
everytime a computer runs a program, they look for a function called
main
a function starts and stops at the curly brackets
every function has instructions inside them. ex.: printf("Hello World!\n");
if a function return 0, the function ran correctly!!!
the
include
lines serve to include files (libraries) with default functions, so it can be used in the program
Print Text on the Screen
write out printf(" "); and put some text inside. the console will print it out.
\n
no fim do texto para quebrar numa nova linha
\t
no fim do texto pra dar um tab
\a
pra que aquela instrução role com um som de alerta do sistema
Comments
use comments to
explain
things
/
comment inside
/ - to break your comment in lines
// comment do lado
- to put your comment in just one line
Conversion Characters
instead of writing printf("Laura is awesome!\n");
you can write printf("%s is awesome", "Laura");
a
percentage something
always is a substitution. examples: %s for strings, %d for numbers (integers), %f to decimals (float)
Variables