anyone?
Type: Posts; User: CyC|OpS
anyone?
Hi,
I ve got problem in implementing ADT in my program,
below I posted my PQ.c, PQ.h -> which is the ADT (not full ADT) you'll see why in my code...and office.c+ office. which is the program...
Got it now,
thanks so much for your help :)
Ferdinand
thanks Hammer,
but that doesnt anwser my question,
I am confuse coz free( Array ) doesnt free the memory ( I still can access them...
and free( &Array[1] ) OR free( &Array[number between...
thanks Prelude + Moi,
I ve got the idea now....
but got another problem...
if I got this structure...
struct arr
Hi,
just wondering if I am allocation (totalsize) * (sizeof mystructarray), is it normal if it gives me segmentation fault when I am trying to access mystructarray[totalsize+1]?
just wondering...
hei thanks to both of you,
Hammer : yeah, maybe I just give up the description dynamic memory allocation...should be alot easier...
Salem : I'll try to read the file first and allocating...
Thanks Hammer & Salem for your help,
for Hammer : I must use dynamic memory unfortunatly.
for Salem : ypu're right....I dont know the size of the file.. =( , is there any other way to...
is this mean I can't use &string[i]?
umm..I "know" that was the problem, and I tried to allocated memory for TRec, but honestly I dont know where should I do it, and I dont know the size of TRec (how many tasks are in the array)...and...
Hi, I got a problem with memory allocation (that's my assumption) in my prog...
My program purpose is to read from file and put it inside the struct array TRecord.
this is the file format:
...
yeahhh, I ve just figured that out and want to post it...
thanks anyway Hammer :)
I ve got alot of very helpful response from this board
btw, i ve just voted for u ^_^
CyC|OpS
exactly!!!
I ve one variable which i declared as global variable inside header file..and i didnt declared it in other source file...
int var = 2;
how can i overcome this prob??
CyC|OpS
there's no error when i compile the object files
> gcc -c maindriver.c
> gcc -c functions.c
however it gives errors when
> gcc -g -Wall -o progname maindriver.o functions.o
the prog working...
anyone can help? I ve worked on it for the whole night and still can't figure it out...
*_*
thanks Shiro :)
thats explain alot...
I just finished separating my program...
the skeleton is exactly the same as Strider post above..
however, when i compile it
> gcc maindriver.c...
#ifndef FUNCTIONS_H
#define FUNCTIONS_H
/* function here...*/
#endif
how is this #ifndef & #endif work??
hi David,
thanks for your explanation...very clear :)
now how to compile it?
issit only calling the main.c
eg: gcc main.c
or i need to call the dependecies too? .h and functions.c?
hi,
I ve questions bout header files...
for example if I have main function like below, how can i separate it into .c and .h files, to make it neat and more efficient..
#include <stdio.h>
um...nobody can help issit? :(
or u guys dont understand what is my question?
Hi,
I ve array of structure..
struct record
{
int key;
char *word;
oh okie...
i dont know about that =)
I think thread closed now.
Thanks Salem!!!
It did workingggg, omg i dont believe it...
thank you very much :)
o yeah about the malloc... do u mean that I dont need to allocated the memory?
sincerely,
Hi,
I recently make this code to concate 2 string...i am using cygwin at home...and this code working as i expected :
char *str_concat( char *string1, char *string2 )
{
char *string3;...
Hi,
anybody know where I can find a good E-book for C, dont have enough money to buy a real book....
thx
Ferdinand