when to use & ( & means ampersand) in scanf

use & in scanf when dealing with numbers; 

example;

int num1;
printf("enter number:");
scanf("%d", &num1);



char name[20];
printf("enter name:");
scanf("%s", name);

Comments

Popular posts from this blog

Using Struct C

arrays in c programming

for loop with index in C