Yes sorry I was so unclear, that was what I wanted to do. In maple you can just type 1/N mod R and it gives the correct answer 1089etc however wasn't sure how to do this in C.
Does the extended...
Type: Posts; User: manutdfan
Yes sorry I was so unclear, that was what I wanted to do. In maple you can just type 1/N mod R and it gives the correct answer 1089etc however wasn't sure how to do this in C.
Does the extended...
Yeh I guessed this was the problem, how would I go about anything other type of arithmetic to get the required result.
Right, am having a problem when using a modulo calculation in my program.
Trying to do the calculation below,
N = 1073741827
R = 4294967296
N' = (1/N) (mod R) = 1789569707
The code I...
Cheers guys, that was the problem have just resorted to using a for loop to calculate pow value instead.
Thats really odd, i've tried re-writing it into a single function which i've posted below and I still get the same problem.
im using Dev C++ to compile in windows. Cheers for looking at it.
...
Hey,
I have written a piece of code to do as the title says, but I seem to have a problem in that any odd number of digits is converted wrong. eg. it converts 25 correctly but not 125.
it...
thanks I thought it would error because of the different data types.
I was just wondering whether it is possible to convert characters into their ASCII values or values in the alphabet easily without needing a load of if statements.
The only way I can think of...
thanks, thats great it works now
no sorry I am trying to remove all the apostrophes from my list so when it is searched they don't appear in words.
so I was trying to compare each character in the list with an apostrophe to...
so i should use
x[b] == '\"'
because it doesn't seem to work.
I want to remove apostrophes from my text, but if I use the following statement it thinks there are too many as they are the initialiser for the query. How would I get round this? I was wondering...
thanks, I realised I only needed to transfer them back to print out so I have just incorporated the printf statements into the search function.
Just wondering is it possible to condense the printf...
duh of course I get a pointer error as it is the start of the list, anyway it now seems to work although b should be the number of times a word occurs in the list and it doesn't always seem to be.
...
right i've done that now and it has solved the problem, which gives me another one.
The pointer stored in root->next is the memory address of the next word which I know is correct, although it...
i've changed that now but I still get the same problem, it has me baffled as the root->next node points to the correct memory address but it seg faults.
so this would be solved be inserting the calloc statement before the function is called rather than in the function?
I was messing about with the search function to see if there was anything wrong in it, and I found that the root->next is connected together correctly.
I used the following code to test whether...
how would I solve this problem? because the way I have stored it isn't the last thing stored using the insertlist function the head of the list. As all the pieces of data are linked to the one added...
when I debug it, it seg faults when it tries to re-call itself as the root->next address is invalid.
although I have changed the return now so it returns a instead of 0 but I have the same...
well a is incremented in the program which then calls itself, so it shouldn't be 0 when the search gets to &, and the program would not compile without the return 0
also is it possible to return...
ok, im quite a bit furthur with this project but I have another problem *surprise*.
I have got my program to read the list in now, but I am trying to search it and it seems to start the list at...
Thanks, I have it working now. I just have a question about freeing the calloced memory.
Because I need to use this in the main program for furthur operations, how do I go about freeing it. Can I...
Is it possible to pass pointers between functions?
the readdata function has been fixed so it works properly now but I can't seem to get it to pass a pointer back to the main function, I have...
[Code]
ifp = fopen(name, "r");
[\code]
is this line in the program before correct?
I seem to be getting a segmentation fault as a result of this line not working correctly, it is supposed to...