Sorry Sanju but u have mixed up Unix file format ( aout , coff , elf and as86 ) with that of Windows. Compiling the file as u said (gcc -o file file.c) wont create file.exe but rather create an output file with the name 'file' only. And u can run that like ./file
U may even skip '-o ' option in gcc and that will produce an output file named a.out that can be run as ./a.out (Though the native format of Linux is ELF in this case it produces output file of aout format)
And as for Bell plz. follow jim's advise.
I know this is way late for your assignment, but I'm new to the forum. All I was going to add is this "end of line" error probably has to do with your Visual code using DOS CarriageReturn+LineFeed (0x0D0A respectively) for end of record delimiter while Linux (even psuedo-Linux like cygwin) uses just newline (0x0A). (Actually, I think Cygwin has an option for CRLF, but that's another matter.) You can use the Unix translate utility, "tr," to axe the extra character, i.e. ixnay the CR, like so:
tr -d '\r' <dosfile_crlf.c >unixfile_nl.c
Hope this proves helpful in the future since I was not in time for your assignment.
~Marcus
ok, this is sort of a misconception. gcc compiles both. I just finished an ADMIN control area in C++ with the .cpp extension and compiled it with gcc without problem. but in response to the actual problem here, id just use this line.
we'll call the source EXAMPLE.cpp, and the output will be EXOUT."file".
this is a good choice for debugging and compiling, it calls upon the normal system area for #include header files, uses the Wall function for the debugging side of things, ansi for ..... ansi compatibility i think and the -o gets rid of the a.out leaving you with the desired file, with the blank extension for linux/Unix.... hope that helped..Pe@cE