Skip to content

Instantly share code, notes, and snippets.

@ganobrega
Last active May 23, 2018 02:34
Show Gist options
  • Save ganobrega/90b8e164098953739085e6f3dfec79bc to your computer and use it in GitHub Desktop.
Save ganobrega/90b8e164098953739085e6f3dfec79bc to your computer and use it in GitHub Desktop.
Linguagem C
#include<stdio.h>
#include<stdlib.h>
void exemplo(int *a, int *b, int *c){
*a = 3;
*b = 4;
*c = 5;
}
void exemplo2(int a, int b, int c){
a = 6;
b = 7;
c = 8;
}
int main(){
int a = 0;
int b = 1;
int c = 2;
printf("-------- EXEMPLO PONTEIRO --------\n");
exemplo(&a, &b, &c);
printf("A: %d \n", a);
printf("B: %d \n", b);
printf("C: %d \n", c);
printf("-------- EXEMPLO NORMAL --------\n");
exemplo2(a, b, c);
printf("A: %d \n", a);
printf("B: %d \n", b);
printf("C: %d \n", c);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment