||=== ff, Debug ===|
warning: char format, different type arg (arg 2)| //on scanf
warning: implicit declaration of function `strlen'|
warning: char format, different type arg (arg 2)| //scanf
||=== Build finished: 0 errors,3 warnings ===|
||=== ff, Debug ===|
warning: char format, different type arg (arg 2)| //on scanf
warning: implicit declaration of function `strlen'|
warning: char format, different type arg (arg 2)| //scanf
||=== Build finished: 0 errors,3 warnings ===|
The compiler is telling you that you lied to scanf by giving it one type and telling it to expect another.
Probably forgot to #include <string.h>. You used the function without properly declaring it, just like it said. Including the header file would include a declaration of the function.
See first warning.
scanf("%70s",&f);
f is declARED as char f[71];
And your point?
%s and friends are expecting a char *. When you pass an array to a function, it decays to a pointer to its first element. This means this would work just fine:
On the other hand, &f is a different type than f. &f is a pointer to an array of 70 chars. That is totally different.Code:scanf("%70s", f);