c - fixed length array in scanf.Warning with format -


so have typedefed following :

typedef char array[25]; 

in code somewhere call scanf :

scanf("%s",array); 

but warning %s expecting char* while pass char*[25].is there way rid off warning ?

typedef defines data type can use define different variables same data types. like:

typedef char employee[25]; typedef char customer[25]; employee a, b; customer y, z; printf("enter first employee's name: "); scanf("%s",a); printf("enter customer's name: "); scanf("%s",y); 

though datatypes same, defining them elaborating things. need here is: take array a; , scanf("%s",a);

hope clear core! :)


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -