#Input file is the same as output file, compilation terminated
1 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
#include <stdio.h>
#include <ctype.h>
int main ()
{
char unit;
float temp;
printf("\n IS your temperature in C or F ");
scanf("%c",&unit);
unit = toupper(unit);
printf("\n What is the temperature ? ");
scanf("%c",&temp);
if (unit == "C")
{
temp = 32 + (temp * 9)/5;
printf("\n La temperature est %0.1f ", temp);
}
else if (unit == "F")
{
temp = (temp-32)*5/9;
printf("\n La temperature est %0.1f ", temp);
}
else
{
printf("\n please enter valtire temperature unit ");
}
}
the error gcc: fatal error: input file ‘/home/mouad/Desktop/Learning/convertisseur’ is the same as output file
compilation terminated.
you're trying to compile your C code into the same file
I assume you're using some extension to run code based on the use of absolute paths
if that's the case, try putting an extension on your file
i don't think so or at least idk
absolute paths are because im running it on linux terminal
gcc convertisseur -o .../convertisseur
your file is called convertisseur, then you try to output binary to the same file
the file is still called convertisseur
should i just rename it ?
this was just to point out what was going on
not the command you should use
yeah
either rename the file or the output
This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.