Hello, consider this skeleton of a program I was writing -
My problem is not with the logic but with some syntax. Here, copystrings does not return anything, so it's declared as returning void. getline returns an int, and it's declared as such.
When I compile this using cc on Fedora linux, the warnings I get are these
If I put a function prototype for copystrings above the main method, there are no warnings.
My question is, why don't I get a similar warning for getline as well?
Code:
main(){
getline(...
copystrings(...
}
void copystrings(char a[], char b[]) {
...
}
int getline(char arr[], int limit) {
...
}
When I compile this using cc on Fedora linux, the warnings I get are these
Code:
warning: conflicting types for ‘copystrings’ note: previous implicit declaration of ‘copystrings’ was here
My question is, why don't I get a similar warning for getline as well?
Comment