Search Results

Showing results 1 to 20 of 20
Search took 0.01 seconds.
Search: Posts Made By: Agni ; Forum: C and child forums
Forum: C May 4th, 2009
Replies: 2
Views: 380
Posted By Agni
Reading this code is a pain..Can you format the code properly and use the language specific code tags? Also please point the function where you are printing the contents.
Forum: C Feb 27th, 2009
Replies: 2
Views: 352
Posted By Agni
I guess you can look at using the gnuplot library for simple graphs etc. i'm assuming you are working on *NIX
Forum: C Feb 23rd, 2009
Replies: 2
Views: 293
Posted By Agni
You don't need to create 3 threads for the same problem. 1 would be enough.
Forum: C Feb 7th, 2009
Replies: 18
Views: 1,266
Posted By Agni
C:\PROGRA~1\MICROS~1.0\VC>test.exe
Input a string: she sells sea shells at the sea shore but the sea

Output:There are 10 words

That seems like a wrong output to me.
Forum: C Feb 7th, 2009
Replies: 18
Views: 1,266
Posted By Agni
:) well its getting useless now, I'm sure with 'minor' changes we can achieve a lot with anything.

Mr. OP if you've got what you wanted, please close this thread now.
Forum: C Feb 5th, 2009
Replies: 18
Views: 1,266
Posted By Agni
If the instructor hasn't explained the difference we can do, and that's why i pointed it out. It was more of a piece of info than anything else.



really?? Why don't you take his code, run it as...
Forum: C Feb 5th, 2009
Replies: 18
Views: 1,266
Posted By Agni
Then you can first move the pointer to the starting of the first word.some thing like this


while (str[i++] == ' '); // move the pointer to starting of first word
while (str[i] !='\0')
{......
Forum: C Feb 5th, 2009
Replies: 18
Views: 1,266
Posted By Agni
Also it will still tell you one less than the actual number of words in the sentence. Because you are counting the spaces not the words. eg

Sentence-> I am a good boy
spaces-> 4, word_count = 4...
Forum: C Feb 4th, 2009
Replies: 4
Views: 1,158
Posted By Agni
malloc returns a void* to the memory allocated and you need to ensure that you type cast it to the correct type.
Forum: C Feb 2nd, 2009
Replies: 4
Views: 466
Posted By Agni
see this thread
http://www.daniweb.com/forums/post451380.html#post451380
Forum: C Feb 2nd, 2009
Replies: 13
Views: 7,636
Posted By Agni
hasta la vista baby
Forum: C Nov 26th, 2008
Replies: 2
Views: 292
Posted By Agni
They are declared in the parameter list so that you can pass address to the function. if you declare them as local variables inside the function how will you pass the address of the variables to that...
Forum: C Aug 6th, 2008
Replies: 14
Views: 1,706
Posted By Agni
I assumed you needed multiple files open at the same time, for above requirement AD has already given you the code. Go through it.
Forum: C Aug 6th, 2008
Replies: 14
Views: 1,706
Posted By Agni
or else you can use an array of FILE* if you want to use them elsewhere in the program. or write a structure with elements as FILE* and filename and use an array of that structure.
Forum: C Jul 16th, 2008
Replies: 3
Views: 1,240
Posted By Agni
what is this? what do you want us to do with this? I'm pretty sure this doesn't work.
Forum: C Jul 16th, 2008
Replies: 12
Views: 845
Posted By Agni
It all boils down to understanding how arrays are stored in memory and how we access each element of an array.

arrays are stored sequentially in memory. So lets say you declare and array of 5...
Forum: C Jun 24th, 2008
Replies: 5
Views: 4,608
Posted By Agni
And please check for succesful allocation and if yes then dont fgt to free this block of memory once you'r done
Forum: C Jun 24th, 2008
Replies: 5
Views: 4,608
Posted By Agni
malloc allocates memory and returns a pointer to the beginning of that block of memory. You need to assign it to some pointer not an object as you are doing here. Change that to pointer and it...
Forum: C Jan 30th, 2008
Replies: 3
Views: 778
Posted By Agni
but you needed to re-insert the 84 char string again into the new string..rt?
Forum: C Jan 30th, 2008
Replies: 3
Views: 539
Posted By Agni
whats the error that you're getting??

for array of structure say
Showing results 1 to 20 of 20

 


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

©2003 - 2009 DaniWeb® LLC