Forum: C Oct 5th, 2007 |
| Replies: 11 Views: 3,149 Ok I'm not too sure. But this might have something to do with dependancy. Is there more than 1 makefile in your download?
One of Dev-C++ shortfalls is it can't compile multiple projects all at... |
Forum: C Oct 5th, 2007 |
| Replies: 11 Views: 3,149 DEV C++ compiles C or C++ just fine. What is the reported error ?
The links you posted give me a 404 page not found error. |
Forum: C Aug 30th, 2007 |
| Replies: 17 Views: 2,279 It works but it is platform dependant and incurrs a lot more overhead than getchar(). Most C/C++ developers of any ilk will tell you not to use system("pause").
If you search on this site or using... |
Forum: C Aug 29th, 2007 |
| Replies: 17 Views: 2,279 I'd like to know more about why this is better. I understand the fflush to force the buffered printf output to the screen immediately. But why the cast to void for getchar's return value? Does this... |
Forum: C Aug 21st, 2007 |
| Replies: 11 Views: 1,805 Read Hamrick's earlier post it's far more elloquent. Where Hamrick talks about the stack pointer moving down to reach the return value of the function. Therefore, all the local variables that were... |
Forum: C Aug 21st, 2007 |
| Replies: 11 Views: 1,805 Ah thanks Ancient Dragon now we know. |
Forum: C Aug 21st, 2007 |
| Replies: 11 Views: 1,805 I haven't programmed a lot of C but to the best of my knowledge:
unsigned char ucBufr = NULL;
1. This is not a null pointer, it's a char variable (1 byte set to 0).
>I know that after... |
Forum: C Aug 13th, 2007 |
| Replies: 6 Views: 1,179 If you mean Windows, then you are best searching for C Windows API to find links like this one:
http://www.fastgraph.com/help/first_c.html |
Forum: C Sep 8th, 2006 |
| Replies: 8 Views: 1,408 It's ok it doesn't hurt too much ;) he he
anyway at least we know you got the message now.
Of course we don't expect you to know all the rules straight off. If you look in my signature there's... |
Forum: C Sep 7th, 2006 |
| Replies: 5 Views: 1,307 No they are opposite.
c = *a; //You are assigning the value that a points to *into* c
*a = c ; //you are assigning the value in c into what a points to
You always assign RHS to LHS, left to... |
Forum: C Sep 7th, 2006 |
| Replies: 8 Views: 1,408 He he, well like they always say:
"Big red and firey, always late"
:lol: |
Forum: C Sep 7th, 2006 |
| Replies: 8 Views: 1,408 Wolfpack just gave me this URL
http://www.daniweb.com/techtalkforums/thread50780.html
Moral:
Search the forums before posting. |
Forum: C Sep 7th, 2006 |
| Replies: 8 Views: 1,408 I think both goes on the stack both times. Would only go on the heap/free store if you use the 'new' keyword.
Wolfie ?
p.s.
Yeah and put [ CODE ] [/ CODE ] around JUST the code not the whole... |
Forum: C Aug 3rd, 2006 |
| Replies: 28 Views: 2,912 Wow how old are you ? I'd expect to find you at slashdot rather than daniweb.:cheesy: I've read about those days, you submitted your code and didn't get output until that afternoon or maybe the next... |
Forum: C Aug 3rd, 2006 |
| Replies: 28 Views: 2,912 Well ok I concede that was perhaps a little strong.
But you are changing tack with the UML arguement. UML is just a method for designing, the field is much narrower you don't 'create' with it. UML... |
Forum: C Aug 3rd, 2006 |
| Replies: 28 Views: 2,912 No no no no no I'm sorry that's completely the wrong way around. (system("pause")/fflush(stdin) getch()/kbhit() are not wood (the language) they are prefabricated table legs/lego bricks made for... |
Forum: C Aug 2nd, 2006 |
| Replies: 28 Views: 2,912 Hmmm...
Yes you should know the language well, but without a compiler (standards compliant or not) it is useless.
The language is just the wood, it is the tool and the "in depth" knowledge of... |
Forum: C Aug 2nd, 2006 |
| Replies: 28 Views: 2,912 But it is clearly defined in the document to which I posted a link. It is important to understand in great depth the tools you work with. It is very possible for a large project to have potentialy... |
Forum: C Aug 1st, 2006 |
| Replies: 28 Views: 2,912 At last the calvary arrives, I was starting to feel like Genral Custer! |
Forum: C Aug 1st, 2006 |
| Replies: 28 Views: 2,912 You are running preprocessor ONLY you said
Did you read the material I posted?
http://www.channelu.com/NeXT/NeXTStep/3.3/nd/DevTools/12_Preprocessor/Preprocessor.htmld/index.html
... |
Forum: C Aug 1st, 2006 |
| Replies: 28 Views: 2,912 It must vary depending on the compiler, here's a good llink for the GNU C Preprocessor. (the one I am using)
... |
Forum: C Aug 1st, 2006 |
| Replies: 28 Views: 2,912 I stated I was guessing and if I have any good material I would quote it.
I came to this conclusion by thinking about it and applying a process of elimination in my mind, by thinking about how a... |
Forum: C Aug 1st, 2006 |
| Replies: 28 Views: 2,912 I'm guessing here, but I recon they cancel each other out.
All directives run on each instance, so:
Preprocessor finds the first instance of a and runs ALL directives on it
a = b = a
Then... |
Forum: C Aug 1st, 2006 |
| Replies: 28 Views: 2,912 Doh! ! I can't believe I am soooo thick!
It swaps every instance of a and b so
printf("%d %d", a, b);
becomes
printf("%d %d", b, a); |
Forum: C Aug 1st, 2006 |
| Replies: 28 Views: 2,912 You havn't done anything with your definitions, try this:
#include <stdio.h>
#define a_b
int main(void)
{
#ifdef a_b
int a = 20, b = 30;
#endif |
Forum: C Jul 27th, 2006 |
| Replies: 30 Views: 23,295 Strictly that's not true because 1 is divisible by 1 and itself, but 1 isn't prime. I prefer:
A prime number has precisely two positive integer factors. |
Forum: C Jul 26th, 2006 |
| Replies: 5 Views: 1,116 Drat, just when you think you know something, it turns out you don't know squat.
I did know hexidecimal was base 16, luckily I don't have to deal with it on a daily basis so I guess I'm losing... |
Forum: C Jul 25th, 2006 |
| Replies: 5 Views: 1,116 Take the first item in the array 0x08
we know from the 0x it's a hexidecimal number (base 8) 0x is how you identify a hexidecimal number the 08 represents the number in decimal thats 8 in binary... |
Forum: C Jul 18th, 2006 |
| Replies: 9 Views: 1,186 There ya go it never takes long for something to happen around here, Kudos to SoS:
http://www.daniweb.com/techtalkforums/thread50370.html (http://www.daniweb.com/techtalkforums/thread50370.html) |
Forum: C Jul 6th, 2006 |
| Replies: 4 Views: 1,499 I compiled and ran your code and it worked as expected for me no problem. What exaclty are you inputing and what exactly is the response you're getting?
Oops you posted just before me. The code... |
Forum: C Jul 6th, 2006 |
| Replies: 3 Views: 888 Ternary operator perhaps ?
int a = 1;
int b = 2;
int c = ((a > b) ? a : b ) |
Forum: C Apr 27th, 2006 |
| Replies: 30 Views: 23,295 you can't edit a post more than 30 minutes after you posted in this forum.
0 and 1 are not prime. Yes 1 is divisible by 1 and itself, but that's the same thing it's only one factor not two factors... |
Forum: C Apr 26th, 2006 |
| Replies: 30 Views: 23,295 Actually dud543 I think this is wrong:|| n % 2 == 0)
That would return false for 2 which is prime. |
Forum: C Apr 26th, 2006 |
| Replies: 30 Views: 23,295 Dude543 yes I like that very much.
Salem good feedback.
So system("PAUSE") then, what gives ? I havn't found anything negative on the internet yet.
Ok I've found it:
... |
Forum: C Apr 26th, 2006 |
| Replies: 30 Views: 23,295 Ok whats wrong with system("PAUSE") ?
I |
Forum: C Apr 26th, 2006 |
| Replies: 30 Views: 23,295 Ah it's just occured to me what Salem meant by square root !
A revised edition:
#include <iostream>
#include <cmath>
using namespace std; |
Forum: C Apr 25th, 2006 |
| Replies: 30 Views: 23,295 Ok here's my best shot. The key rule for a prime number is:
It has precisely two positive integer factors.
So the neatest solution I can think of counts those and quits the for loop as soon as... |
Forum: C Apr 22nd, 2006 |
| Replies: 30 Views: 23,295 DOH! Salem
Johns' while loop was: less than OR EQUAL to 500.
So change to for i < 501 NOT 500.
This is Johns' future your playing with, pay attention. |
Forum: C Apr 22nd, 2006 |
| Replies: 30 Views: 23,295 Here you go. Added for loop in place of while, and commented out the i++ at end of while loop.
Also added int variable col, to print a newline every ten numbers printed to standard out.
... |
Forum: C Nov 24th, 2005 |
| Replies: 2 Views: 999 There is some sotware called Toba here:
http://www.thefreecountry.com/compilers/java.shtml
But I guess there wasn't much call for it, as it isn't supported and only works for Java 1.1.
If... |