Escolar Documentos
Profissional Documentos
Cultura Documentos
Tradutor
function will work directly with the values stored there. Watch
the followingTradutor
program:
#include <stdio.h>int test (int* n1, int* n2){ *n1 = -1; *n2 = -2;
printf("\n\n Values inside test() function: "); printf("\n n1 = %d
and n2 = %d",*n1,*n2); return 0;}int main ( ){int n1 = 10;int n2 =
20;printf("\n\n Values before calling the function: ");printf("\n n1
= %d and n2 = %d" ,n1,n2);test(&n1, &n2);printf("\n\n Values
after calling the function: ");printf("\n n1 = %d and n2 =
%d",n1,n2); return 0;}
Analyzing the context and the program presented, mark the
correct alternative regarding the use of the signs * (asterisk)
and & (ampersand):
Enviar feedback