I have a feeling we were taught C very, very wrong. The only environment we were allowed to use was Borland and a few nonstandard libraries were used on a daily basis. Now I try to compile an old program using Pelles and sure enough, every function call from conio.h is missing prototypes.
Thing is, conio.h is right there in the Include folder. How can I... well, include it? Really I have no idea. It's not that I want to keep working outside of the standard; I'd just like to run a couple those programs for old times' sake (can't install Borland btw)
I have a feeling we were taught C very, very wrong.
Thing is, conio.h is right there in the Include folder. How can I... well, include it?
I have a feeling you weren't taught much C at all.
Have you tried the #include directive? Try quoting with "" instead of <>.
>>2
>Have you tried the #include directive? Try quoting with "" instead of <>.
Quotation marks didn't seem to change anything from brackets.
>I have a feeling you weren't taught much C at all.
Yeah this is what happens when the third world gets access to computers. Having to ask for help in 4chan of all places says a lot about the education system here
Name:
op2011-10-11 17:05
Welp, nevermind. Apparently the names of all nonstandard functions have been changed to start with an underscore. Alternatively, just checked Project options -> compiler -> define compatibility names
>>2 I have a feeling you weren't taught much C at all
Neither were you..
Have you tried the #include directive?
That won't work you fuckwit. What he needs to do is having something like
#define WINDOWS 0
#ifdef WINDOWS
#include <conio.h>
#endif
Then have is compiler only use the WINDOWS flag when it gets compiled on a windows box.
Name:
op2011-10-11 19:01
>>10 That won't work you fuckwit. What he needs to do is having something like
It's already been solved. Taking a closer look at conio.h itself, all functions are declared exactly as I used them back then, but starting with an underscore. And instead of changing every getch() to _getch() and every cprintf to _cprintf and such inanity, you can just check an environment option allowing for compatibility names.
Also oh my god why did I ever try to create a snake game in console, my eyes are bleeding piss
The solution is nonstandard and unportable you moron. Maybe you should pull the tampon out of your ass and read the source code to some "real software". As you read it, note how an real programmer actually handles the non standard C code.
Name:
Anonymous2011-10-11 19:58
>>12 As you read it, note how an real programmer actually handles the non standard C code.
There's a standard way to handle the use of non-standard headers?
Name:
Anonymous2011-10-11 19:59
>>13 There's a standard way to handle the use of non-standard headers?
Yes! Oh geeze, let me guess, you're not a programmer.
The only one I wish I'd been taught in school but wasn't is unistd.h. Imagine how many bad arg parsers this world would be spared if only more people knew about getopt.
>>10,16 The forced definition of feature test macros
Unless you're interested in rolling our own configure, just use #ifdef _WIN32 and let the compiler define it for you.
Name:
Anonymous2012-10-23 7:30
>>1
Serves you right for using IDEs, faggot!
It only hides the compiler's flag options from you, obscuring how the compiler looks for things from you; i.e, making you a ``faggot''