Computer Science Canada void * problem for spreadsheet |
Author: | ramaadhitia [ Sun Nov 26, 2006 11:46 pm ] | ||||||
Post subject: | void * problem for spreadsheet | ||||||
Well hello everybody.i planned to develop simple spreadsheet for my homeworks,and then i decided to use List instead of matrix to represent the spreadsheet cell. well, code below is type declaration for my list in file matriks.h
The list node contains structure named infotype which hold the value of cell and the Value type.1 for integer type,2 string for type,and 3 for storing formula.So i use void * in order to be able to store any kind of data type (integer,string,etc) this is file matriks.c contains function body from matriks.h
well the problem is when i want to allocate some memory space for new list node,i use Allocate function (umm, i made this function,you can see the function body in code above) the strange part is ,i can only use the allocate function just once.you can try the code below to test the allocate function
when i allocate address P, the allocate function works nicely,but when i allocated address Q the function didnt works.i think this is happen because i use void * to store value in infotype structure.what's my mistake? Please help me guys!! (i use mingw compiler (gcc)) |
Author: | Monstrosity_ [ Mon Nov 27, 2006 2:48 pm ] |
Post subject: | Re: void * problem for spreadsheet |
ramaadhitia wrote: Well hello everybody.i planned to develop simple spreadsheet for my homeworks,and then
i decided to use List instead of matrix to represent the spreadsheet cell. Does that mean this is an assignment, or it's to help you do your assignments? ramaadhitia wrote: when i allocate address P, the allocate function works nicely,but when i allocated address Q the function didnt works.i think this is happen because i use void * to store value in infotype structure.what's my mistake?
No one here can help you until you post all of the code or post to code correctly. The code you posted makes reference to variables that are never declared anywhere (like rows and isi). Once you post the actual code that compiles, and specify what's going wrong other then "the function didn't works" (like an access violation perhaps), then we can talk about the other errors. |
Author: | ramaadhitia [ Tue Nov 28, 2006 2:56 am ] |
Post subject: | Thanks for the attention |
i didn't mean to have somebody do my homework.my question just a little piece of my assignment.but now i have figured out the answer. by the way,thanks for your attention,i really appreciate it |