What makes you so certain that a C forum would be the most effective place to ask a PHP question? Be that as it may, the good news is it may actually be a good place to state your problem! Since you...
Type: Posts; User: sphynxter
What makes you so certain that a C forum would be the most effective place to ask a PHP question? Be that as it may, the good news is it may actually be a good place to state your problem! Since you...
If you are on linux, why not simply see if /dev/dvd exists?
That is a common issue with scanf(). It basically takes control of your input buffer, so if you mix it with other functions fun stuff occurs. Can you give a code sample? Or maybe its easiest to say...
for(x = 0;x<3;++x)
for(y = 0; y<3; ++y)
square[x][y] = random();
To fix your initial problem--assuming you use my random.
I also just noticed a boo-boo with my while loop....
Here is how I would do it....
int random(void)
{
static short used = 0;
int r;
while(used & (1 << (r = (rand() % 9))))
Its not even a magic square anyway... is this the whole program?
Ooops I see your random() function.
Just for the sake of personal curiosity, did your compiler issue any sort of warning when you had return; in your code?
To put it in over-simplified terms: since C does not support inheritence, this is the closest thing you can do to achieving that result.
....
Would it be possible to post your code you are using to open the COM port for reading? Perhaps you are making a mistake at that point in your program. Also, how does ReadByte() work?
The way I would recommend doing it, just reading over it is to do the sum of the whole array, see if that is divisible by two (!(grand_total & 0x1) or !(grand_total % 2) or whatever). Then work from...
I would like to specify that you should not use precompiled headers in a production version of your software. Overall, however, if you are using CVS or something similar precompiled headers muck up...
With all due respect to Elysia, perhaps if you describe your help as not very useful without a deeper understanding of a moderately advanced subject in C++ programming, perhaps it is unwise advice to...
/*CALENDAR PROJECT*/
/* including header files */
#include<graphics.h>
#include<conio.h>
int main()
{
int a[20],b=0,l=28;
char c;
int loop=0;
calloop :
You are probably going to hate me for saying this, but the easiest way I am seeing to do this task would be to write a keyboard hook that interprets keyboard events only when your console has focus. ...
Typically one would be printing debug info to std::cerr, but I suppose this is just adding on to brewbuck's previous statement.
Or to make CodeMonkey's even nicer looking...
switch (leapyear)
{
case 0:
{
switch (month)
{
You are on the right track now, DAaaMan64. You are correct in assuming you need to be messing with some platform specific API to accomplish this task. It is platform specific. Which if you think...
The reason the computer science guys may say its evil is that because in C++ you always have the option of creating inline functions.
#ifndef NDEBUG
template<typename T>
void...
Very true, some mallocs keep a full table of handles internally though. So its reasonable to say that with a keen enough understanding of the internal data structures used you could theoretically...
Nurses can't seem to resist programmers. Or thus has been my experience. That or I have a thing for nurses. I am undecided. Another good reason to take up programming is because its a tool in which...
Dear friend,
Your code looks excellent thus far, have you yet studied iostreams? Perhaps this would be a good time to use cin.
Some password crackers try similar types of brute-force permutations in order to force their way in. Would you be trying to accomplish such a feat? I would imagine depending on what you are doing...
Don't get a CS lady silly. You use your cunning to get someone into something completely non-related.
If I am being a doofus here, just tell me if I am on the wrong track. But shouldn't it be something like this?
gcc currency_app.c currency.c -o app