Author: Lucas

shape
shape
shape
shape
shape
shape
shape
shape
Standard

Dynamic Allocation – C/C++ Language

There are three ways to reserve memory space for the storage of information: Use of global variables – the placeholder exists as long as the program is running. Use of local variables – the placeholder only exists while the function that declared the variable is being executed. Reserve a memory space dynamically: request the system,

Standard

Pointers – C/C++ Language

Pointer is a C language feature that consists of: Pointing to or accessing memory addresses. Access variables that are not accessible in a function. Return one or more values in a function. Among others… How to declare a pointer: Tipo *Variável; Example: #include void main() { int *p, q; q = 1; p = &q;

Standard

Calculating Factorials in C

Simple C program that calculates the factorial of any number: #include int main() { int fat, n; printf(“Enter a value for which you want to calculate your factorial: “); scanf(“%d”, &n); for(fat = 1; n > 1; n = n – 1) fat = fat * n; printf(“\nFactorial calculated: %d”, fat); return 0; } How

Standard

Loop For, While and Do-While in C Language

All loops have the same function, which is to repeat an instruction a certain or undetermined number of times. The structure of the FOR loop is as follows: for(inicialização; condição; incremento) comandos; For example: #include voi main() { int x; for(x = 0; x <= 100; x++) printf(“%d”, x); } The program above displays numbers

Latest news

Latest news directly from our blog.