Forum: C May 4th, 2009 |
| Replies: 2 Views: 380 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 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 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 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 :) 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 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 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 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 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 see this thread
http://www.daniweb.com/forums/post451380.html#post451380 |
Forum: C Feb 2nd, 2009 |
| Replies: 13 Views: 7,636 |
Forum: C Nov 26th, 2008 |
| Replies: 2 Views: 292 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 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 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 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 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 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 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 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 whats the error that you're getting??
for array of structure say |