- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 6
- Posts with Upvotes
- 6
- Upvoting Members
- 4
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
31 Posted Topics
Re: Actually, you're not quite there with the sum yet. Try the array {-2, 1, -3, 4, -1, 2, 1, -5, 4}. The correct sum is 6 (4 + -1 + 2 + 1), but your code gives 4. | |
Re: I think you ought to declare your interest: [URL="http://www.pcpro.co.uk/forum/viewtopic.php?t=346675&sid=c98cb9a0974350dc3698a03ac00bac91"] SafeSync - PC Pro not-so-special offer will cost you double[/URL] | |
Re: Could you provide the exact text of the whole exercise? | |
Re: If you want to create a library with ar, you normally do: [CODE]ar -rcs[/CODE] | |
Re: I think you should start by using scanf to read in the number of rows and columns into two variables. Post this when you've written it. | |
Re: Since you don't know in advance how many words there are, and how long they will be, you need to use dynamic memory allocation: 1. malloc 2. realloc 3. free There is no readline function in standard C. There is an fgets function that reads a line of text. You … | |
Re: I'm sure I've said something like this before today, but I suggest you start by reading the date of birth into three integer variables, perhaps using scanf. Let us know how you get on. | |
Re: The pointer is advanced [I]after[/I] the fgetc, so when you look at it, it is always one character ahead of what you have just read. After you have read the last character, it is pointing to garbage. | |
Re: I'm not going to open that. Please post your code here. | |
Re: Do you really want WS_EX_APPWINDOW? | |
Re: From the function names you've given, I think you were looking at this question: [URL="http://www.daniweb.com/forums/post1032112.html#post1032112"]Cursor Base implementation of list problem [/URL] A cursor linked list is a data structure consisting of a linked list embedded in an array. I think the term was coined by Mark A. Weiss in his … | |
Re: I can't see anything wrong with those two functions (well, nothing [i]logically[/i] wrong anyway). You'll need to provide some more context. How is the student list getting populated and how are these functions being called? | |
Re: The input is just a file containing one floating point number on each line. The output is the DFT of each value, normalised by the length of the input, i.e., the value calculated for each individual input will be different depending on the total number of inputs. | |
Re: [code=c]for(i =1;i<=4;i++,printf("\n"))[/code] Do you [i]really[/i] want that printf there? | |
Re: So what is your problem? 1. Reading files 2. Converting filenames You'll need to be more specific. | |
Re: You don't actually need to read in lines to count the paragraphs. You can read using fread and look for double CR/LFs. Note that you'll need to look for 0x0D and 0x0A, because '\n' won't work correctly with fread on Windows. | |
Re: I don't think you should sort. Use two arrays. Read the numbers into the first array, and then scan it N times, looking for numbers to add to the second array: [code=c] unsigned int n; for (n = 1; n <= N; n++) { } [/code] In each scan you … | |
Re: You want: [code=c](*randomcur)->value = generateRandom(j,d);[/code] because [code=c]*randomcur->value = generateRandom(j,d);[/code] is the same as [code=c]*(randomcur->value) = generateRandom(j,d);[/code] | |
Re: There isn't a built in way of doing this. You would need to write a parser. 1. Read each line of the file into a buffer using fgets (assuming you know the maximum line length). 2. Walk through the string until you come to the next separator, and copy what … | |
Re: [URL="http://sourceforge.net/projects/phpexcelreader/files/Spreadsheet_Excel_Reader/"]PHP-ExcelReader[/URL] You would have got a faster response in a PHP forum. | |
Re: I should add that you could also consider sorting a linked list by turning it into a binary tree and then back into a list again. [URL="http://www.martinbroadhurst.com/articles/sorting-a-linked-list-by-turning-it-into-a-binary-tree.html"]Sorting a linked list by turning it into a binary tree [/URL] | |
Re: From your description of the problem you don't need to [I]change [/I]append, you need to [I]not use [/I]append. In the places where you would append a node to list3, you want to just print its value instead. | |
Re: [code=c] #include <stdlib.h> int main(void) { system("program1"); system("program2"); return 0; } [/code] | |
Re: If you're using gcc, you can use objdump to examine object code files. If you use Visual C++, you can use dumpbin. | |
Re: You're off by 1. When you push the first element, it's at stck[1], because you increment top first. You are reading the values back from stck[2] to stck[0] (which is uninitialised), instead of stck[3] to stck[1]. | |
Re: It's the [code]while(0)[/code] on line 32. | |
Re: This is quite straightforward. Your only problem is that Java doesn't have pointers, so you need another way of passing the values to be converted by reference. What you need to do is to put the arguments to the [I]convert[/I] function into a class: [code=java] class convertArgs { public int … | |
Re: The problem is in line 15. You are filling the matrix as if it is an a * a matrix, but it is an a * b matrix. | |
Re: I'm going to answer this thread, even though it is rather old, because it comes very high in the Google search results for "circular linked list", and there hasn't been a comprehensive answer. Firstly, it isn't pertinent to compare a circular list to a singly- or doubly-linked list individually; circular … |
The End.