Search Results

Showing results 1 to 40 of 54
Search took 0.04 seconds.
Search: Posts Made By: niek_e ; Forum: C and child forums
Forum: C Sep 18th, 2009
Replies: 5
Views: 867
Posted By niek_e
Your logic is wrong. 1 KM == 1000 M == 100000 CM.
Forum: C May 7th, 2009
Replies: 5
Views: 526
Posted By niek_e
You should really watch the Fast and the Furious, then you would have known: Nitrous Oxide Systems (http://www.holley.com/index.asp?division=NOS)
Forum: C Apr 23rd, 2009
Replies: 4
Views: 278
Posted By niek_e
In that case, just make the change I suggested in my previous post and this problem should be solved!
Forum: C Apr 23rd, 2009
Replies: 4
Views: 278
Posted By niek_e
What is 'String' ? What are you sending to this function; can you show how you call it? Because I suspect you want:
void update_rw_requests(ReadOrWrite rw, char* algorithm)
Forum: C Apr 15th, 2009
Replies: 19
Solved: array help
Views: 713
Posted By niek_e
Yes! That's exactly what I meant! Good job.



I've asked to move this thread to the C-forum
Forum: C Apr 15th, 2009
Replies: 19
Solved: array help
Views: 713
Posted By niek_e
Come on, look at the code closer:

for(i=0; i<N; i++)
{
printf("enter a number");
scanf( "%d", &nwr);
newary[i] = nwr;
}
Forum: C Apr 8th, 2009
Replies: 14
Views: 755
Posted By niek_e
Some people don't get your twisted way of thinking/humour and mistakenly think that your making fun of them. That's what you get with a forum full of geeks.

Off-topic: bowling sucks, big time. :)
Forum: C Nov 20th, 2008
Replies: 5
Views: 1,279
Posted By niek_e
for c:


/*code goes here */



also explained here (http://www.daniweb.com/forums/announcement8-3.html)
Forum: C Sep 10th, 2008
Replies: 10
Views: 2,202
Posted By niek_e
Telekinesis seldom works for me



How about I help you in the right direction and still stay a sarcastic kind of guy?

Here's a link ...
Forum: C Sep 10th, 2008
Replies: 10
Views: 2,202
Posted By niek_e
With a computer, keyboard, monitor, mouse (optional), an OS and some software. You'll probably need your eyes, brains, arm, hand etc too.

In other words: Try something yourself first and come back...
Forum: C Sep 3rd, 2008
Replies: 4
Views: 529
Posted By niek_e
because 'i' is already an declared as an int. 'A' was declared as an array of doubles.

Now in your particular case i and a[i] have the same value because of the initializing for() loop you asked...
Forum: C Sep 3rd, 2008
Replies: 4
Views: 529
Posted By niek_e
It initializes the array with the values 1-10.
It's a loop. Every time the loop loops, one element of the array will receive a value. So the first pass i == 0, so a[0] will become 0. The second...
Forum: C Jul 18th, 2008
Replies: 38
Views: 2,441
Posted By niek_e
A bit of-topic, but a moderator (WaltP) once wrote this (http://www.gidnetwork.com/b-59.html)article about scanf(), it's worth the read. (also click the other parts about scanf)

For the rest I...
Forum: C Jun 20th, 2008
Replies: 10
Views: 3,251
Posted By niek_e
Hmm. Let's ask:

@gargg321:

Do you want an array like this:
a[0] = 31
a[1] = 1
etc

or like this:
Forum: C Jun 20th, 2008
Replies: 10
Views: 3,251
Posted By niek_e
@AD:

But that's not what he wants right? I thought he wanted the decimal values of the hex numbers stored as a string in a char-array?
So my code should be OK
Forum: C Jun 20th, 2008
Replies: 10
Views: 3,251
Posted By niek_e
Change the %x to %d with the sprintf()
use %c when printing the chars

this code:

int main()
{
char a[25];
int i;
sprintf(a,"%d%d%d",0x0000001F,0x00000001,0x00271418);
Forum: C May 20th, 2008
Replies: 20
Views: 1,876
Posted By niek_e
I'm actually working with a program for a Fujitsu uController at the moment. Written by (with all respect) an old-school programmer. static this, extern that... bleh..
I'm more of a 'throw pointers...
Forum: C May 15th, 2008
Replies: 18
Views: 1,065
Posted By niek_e
Another thought comes to mind:
Where is your input.txt? Is it in the same folder as the executable? If not: crash
Forum: C May 15th, 2008
Replies: 18
Views: 1,065
Posted By niek_e
That's very strange... AD is right a getchar() should do the trick.
Try replacing the getchar() with:
while(getchar()!='q'){}

Now you'll have to enter a 'q' and 'enter' to quit
Forum: C May 15th, 2008
Replies: 18
Views: 1,065
Posted By niek_e
Two things:
This is a typo: FILE *ifp, ; Remove the comma: FILE *ifp ;

And you might want to read this about void main...
Forum: C May 10th, 2008
Replies: 6
Views: 725
Posted By niek_e
Actually, main DOES return a value. Never mind what you teacher told you or what Turbo thinks is normal, main returns an int. So use int main(void) and return 0;

If you are switching compilers,...
Forum: C May 7th, 2008
Replies: 18
Views: 1,966
Posted By niek_e
So I see...

Perhaps my brain misfired there for a second. Sorry bout that. But the link is still usefull (about pointers)
Forum: C May 7th, 2008
Replies: 18
Views: 1,966
Posted By niek_e
Click here (http://www.cplusplus.com/doc/tutorial/pointers.html)

Also: If you have a question, you should start your own thread (http://www.daniweb.com/forums/faq.php?faq=daniweb_policies), not...
Forum: C May 6th, 2008
Replies: 18
Views: 1,966
Posted By niek_e
That's what you get for using Turbo C ;)

Better option (IMO) are:
- visual studio express (http://www.microsoft.com/express/vc/)
- Bloodshed DevC (http://bloodshed-dev-c.en.softonic.com/)
-...
Forum: C May 6th, 2008
Replies: 18
Views: 1,966
Posted By niek_e
Close, but a few things:
- it's int main() and return 0; Click here (http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044841143&id=1043284376)for info
- Clrscr() is not standard. I'm using...
Forum: C Apr 14th, 2008
Replies: 1
Views: 486
Posted By niek_e
if you want the power of something, you need the pow() function. You can't do y^2, you need to write it like pow(y,2);

Niek
Forum: C Apr 8th, 2008
Replies: 16
Views: 2,261
Posted By niek_e
I've had this problem in the past. I used a custom function made by someone else, because I couldn't write my own...

Click...
Forum: C Apr 4th, 2008
Replies: 7
Views: 871
Posted By niek_e
Did you #include <windows.h> in your project?
Forum: C Jan 16th, 2008
Replies: 10
Views: 4,000
Posted By niek_e
If it only get's that error if the FIRST char = '?' or '*'try checking if 'err' == REG_BADRPT . If so: report back.

Niek
Forum: C Jan 9th, 2008
Replies: 10
Views: 1,730
Posted By niek_e
Haha :)

Perhaps you should add a getchar() before your return 0; , this keeps the window open when the program is done running.
The code you've posted works fine, I've tested it on VC8 with my...
Forum: C Jan 9th, 2008
Replies: 10
Views: 1,730
Posted By niek_e
It's allowed both ways by compilers, (because sizeof is an operator, not a function) but I always put brackets around the 'argument' for readability. It's a mather of personal taste, like indenting...
Forum: C Jan 9th, 2008
Replies: 10
Views: 1,730
Posted By niek_e
Minor correction on that one:
while ( fgets( str, sizeof(str), fp ) != NULL )

regards Niek
Forum: C Dec 12th, 2007
Replies: 11
Views: 2,045
Posted By niek_e
I tried to run your code and came across the above. You're checking if x<10 BEFORE it is assigned a value... This will crash your program.
Change it to this:

x=z%10;
if (x<10)

And you're...
Forum: C Dec 12th, 2007
Replies: 11
Views: 2,045
Posted By niek_e
What WaltP is trying to say is that: if (x<10&&x>20) is wrong:
This statement means: if x is less then 10 AND bigger then 20. What number do you know that is smaller then 10 and bigger then 20?...
Forum: C Dec 10th, 2007
Replies: 8
Views: 925
Posted By niek_e
I would also check if opening the file(s) was a succes or not. This will spare you the memory exceptions in the future.

Niek
Forum: C Dec 3rd, 2007
Replies: 3
Views: 2,041
Posted By niek_e
Sure:
system("more /proc/cpuinfo > /tmp/file");
Now just open the file /tmp/file and read the data that you want.
Or you could use a named pipe with one end in your C-program and "more...
Forum: C Nov 9th, 2007
Replies: 10
Views: 2,097
Posted By niek_e
No such problem here. I have to agree with Narue, your code works (more or less) for me. There are a few other thing wrong with it though: Always initialize your vars with a value! Always check if...
Forum: C May 3rd, 2007
Replies: 36
Views: 7,543
Posted By niek_e
That's because the char you entered is still in the buffer. It's a bug in scanf(), you shouldn't use it. Link (http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044873249&id=1043284392)
Also:...
Forum: C Jan 4th, 2007
Replies: 11
Views: 16,753
Posted By niek_e
Not quite there yet. Try 11 rows. The formatting will be all messed up because your program doesn't take into account that numbers might have more then 1 digit, so the more rows you enter, the more...
Forum: C Jan 4th, 2007
Replies: 11
Views: 16,753
Posted By niek_e
printf(" %5d",a[1][1]);
That's your first line, so that's the maximum number of spaces from the left of the screen. This won't work, because if you get more then 3 lines there won't...
Showing results 1 to 40 of 54

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC