2
I’m trying to compile this code,do use head C but it’s returning me errors
#include <stdio.h>
void go_south_east(int* lat, int* lon)
{
*lat = *lat -1;
*lon = *lon - 1;
}
int main()
{
int latitude = 32;
int logitude = -64;
go_south_east(&latitude, &longitude);
printf("Avast! Now at: [%i, %i]\n", latitude, longitude);
return 0;
}
Error:
root@kali:~# gcc testmains.c -o testmains testmains.c: In function ‘main’: testmains.c:14:28: error: ‘longitude’ undeclared (first use in this function) testmains.c:14:28: note: each undeclared identifier is reported only once for each function it appears in
Welcome to [en.so]. Could you clarify what your question is? What error is the compiler returning? Enjoy and make a [tour] by the site and check out the guide of [Ask].
– Math
What mistake are you making exactly?
– C. E. Gesser
Welcome to stackoverflow in English! Try to better explain your problem, the error that occurs to you and what you intend to do, so it is difficult for someone to answer...
– Jorge B.
Wow, why did they negatively?
– Leonardo Oliveira Sdd
Well, I didn’t deny it, but I believe it was because it’s unclear what you’re asking. The situation can be reversed easily, no need to worry. Start by clarifying your question: what error are you having? What you hope will truly happen in your code?
– Math
root@kali:~# gcc testmains. c -o testmains testmains. c: In Function ːmain': testmains. c:14:28: error: ŋ longitude' undeclared (first use in this Function) testmains. c:14:28: note: each undeclared Identifier is reported only Once for each Function it appears in
– Leonardo Oliveira Sdd
Maybe you prefer [Edit] your question to add the error, it becomes clearer to read.
– Math
You declared "logitude" (sic). It was a simple typo.
– Rodrigo Guedes