[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: [LI] C Programming problem



Hi,

> mrinal, first of all this code is supposed to give compilation error in gcc.
> reason : whenever you declare a block you need to define the variable first
> then you ask for a function. your block started immedietly after main(). this
> is ANSI specification. so you may have got some difference in tc and gcc.

Oops, this confusion seems to be because I compiled the program as a C++
program, i.e. using g++, and C++ seems to allow variables to be defined
anywhere.

Also - the void main() - when I compile with gcc -Wall, it says
``warning: return type of main is not int'', and when compiled with g++ -Wall,
it says : ``warning: return type of main changed to int''!

Pity, this is the way we are taught at school..

Does anybody know of any screen library like curses, which is portable between
Linux and DOS (gcc/DJGPP)? I checked out the ncurses page, but there seems to
be no DOS port.  

----------------------------------------------------------------
Mrinal Kalakrishnan
mrinal@xxxxxxxxx
http://listen.to/mrinal
----------------------------------------------------------------
--------------------------------------------------------------------
The Linux India Mailing List Archives are now available.  Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.