Thread: LValue Required
View Single Post
  #4 (permalink)  
Old 07-05-2008, 05:16 AM
v0id's Avatar   
v0id v0id is offline
Retired
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,629
Last Blog:
CherryPy(thon)
Rep Power: 28
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default Re: LValue Required

Quote:
Originally Posted by Goodluck
But I don't understand "Non-compiler independent libraries" like conio.h. Why can't I use it? If I want to use a function like getch() then which library should be included?
conio.h is not a part of the C programming language. It was originally made for the old MS-DOS compilers, but has been ported to newer platforms through the time, but it's by no mean cross-platform, so if you're developing for multiple platforms, this is not the right library to use.
If you just want it to run on the platform you're currently using, then do it. You just have to keep in mind, that it's not a standard library.

Quote:
Originally Posted by Goodluck
Why should main() function return an integer value? What it does when we use void?
I was actually wrong on this one. I checked the C standard, and realized that it's actually up to the user (or compiler) how the main()-function shall be implemented in C. It's not like that in C++. In C++ you have to implement it using an integer as a return, and that's why I assumed it was the same in C.
The C standard is not online, so this is the best link I could find regarding C and the main()-function:
FGA: "void main()" is not legal in C++ but is legal in C

Quote:
Originally Posted by Goodluck
Sorry, I am a beginner to C. Please guide.
Don't apologize, we all start somewhere. It's good that you're asking these questions. Many beginners would just think "okay," and just do it, without actually understanding it.
__________________
05-03-2007 - 11-13-2008
Reply With Quote