#Input file is the same as output file, compilation terminated

1 messages · Page 1 of 1 (latest)

finite aspen
#

Hello here is my code, i don't know how to solve the error, google research was unfruitefull, the onyl few forums who speak about my problem went unanswered, for info im running on ubuntu

uneven laurelBOT
#

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.

finite aspen
#

#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.

abstract galleon
#

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

finite aspen
#

i don't think so or at least idk

#

absolute paths are because im running it on linux terminal

abstract galleon
#

gcc convertisseur -o .../convertisseur

#

your file is called convertisseur, then you try to output binary to the same file

finite aspen
#

still doesn't work ><

abstract galleon
#

the file is still called convertisseur

finite aspen
#

should i just rename it ?

abstract galleon
#

not the command you should use

abstract galleon
#

either rename the file or the output

finite aspen
#

well renaming it didn't work

#

still same error

#

how do I rename the output

uneven laurelBOT
#

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.