I am new to C and pelles - C, i am using windows 7 and virtual box buggs me so i installed pelles - c, i have been working only with borland C & CPP compiler,so i find it very hard to start with Pelles - C so some help please..
my problem for example - i tried to execute " HELLO WORLD" program to check how pelles - C works, but it wont accept clrscr, getch and SCANF!! void main is ot allowed, it is int main(viod)... i am a borland guy so please help me starting with pelles - C
Lots of people moving up from Turbo C or Borland TC++ run into these problems. It's about the standards used... Borlands products predate modern standards so you could get away with a lot of pretty strange stuff whereas Pelles C is C99 standard and will, to some degree, enforce compliance with that standard.
For example: void main () is not a good idea because main() is expected to return an errorlevel back to the operating system. Also in C99 the a function with () is allowed to accept any number or type of parameters where a function that accepts no parameters is written as (void)... So the correct form is int main (void) and it returns 0 for success.
In C99 your "hello world" program looks like this...
#include <stdio.h>
int main(void)
{
printf("Hello World!\n");
return 0;
}
If you start the IDE click on following chain...
Help -> Contents -> (help window opens) Contents -> Integrated Environment -> POIDE Integrated Envifonment -> Your First Project : Hello World
... you will find a nice little tutorial on how to create your first project.
While you are in the help file, spend some time familiarizing yourself with it. It's going to be your best friend when writing C99 programs in Pelles C... It's all there... complete information on the IDE, C99, the command line tools, every library function (both standard and extended).
Also, be aware that placing your text cursor on a coloured keyword and pressing F1 will fetch help on that keyword for you. (Very handy!)
Pelles C does provide the non-standard conio.h ... but most C99 compilers do not. So I would strongly suggest that instead of trying to make Pelles work like Turbo C... you should learn to do things the new way since that's how you write the best, most portable, code.
If you notice, all non-standard functions are clearly marked in the help file, and their names always begin with an underscore. This is to ensure that you know you are writing code that may not work on a different compiler.
As the others have suggested, you can use the "Define Compatibility Names" option in Project -> Project Settings -> Compiler to remove the leading underscore, but be aware this will mask compatibility issues and may result in code that produces huge numbers of errors on other compilers.
I'm very aware that some backwards schools (particularly in India) are still teaching with the older compilers and standards. It is unfortunate that students get this "kick in the groin" realization that most of what they learned is next door to useless to them with modern tools. You will have to make a lot of adjustments to get up to speed on C99... and, yes, before you say it... there was no excuse to not teach you C99 from the beginning, it's been around for over a decade.