See you guys.
I don't think I'll be back here.
Thank those guys who helped me.
Type: Posts; User: paulur
See you guys.
I don't think I'll be back here.
Thank those guys who helped me.
Salem,
you're really hard to be communicated. would you please ignore my message?
Thanks!
Paul
ssharish2005,
Here is the code. You can see at line 18, which is commented because malloc() doesn't work here, and i've got to put it at line 35.
14 struct record *...
My question is that it's supposed that malloc can be called at either place; but my program only works if malloc is called at //comment 2, but does not work if malloc is called at //comment 1.
I...
ssharish2005,
Thanks for the message.
My real code is a bit more than what is shown, but like following:
struct record * build_record(struct record* rec, int rec_id){
string...
Here is the code:
struct record * build_record(struct record* rec, int rec_id){
//comment 1 ????
//rec = (struct record *)malloc(sizeof( struct record));
rec->id ...
Salem,
Thanks for reply.
The problem is that if malloc() is put in the loop of create_rec_array(), the program works; but if malloc() is in create_an_rec(), it does not work. That's my...
Sorry about the confusing code.
What i want to ask is that if
recs[i] = malloc( sizeof( struct record) );
is declared in create_record_array(), the program runs correctly; but if the...
I've got an array of struct pointers as following
struct record{....}
struct record*[]
and two methods:
create_a_record(struct record*)
Yeh, that really is the reason casued the error!
But I just can't understand why it likes that. because both stringArr and l are char**....
Many thanks!
Paul
Hi,
I want to assign values to a string array, which is declared as char** stringArr, by reading a file. One line of the file is to be one element of the string array. My code is as the following:...
I've just figured out by myself as the following :D
hope it can help anyone in future. And thanks for the helps from these nice guys.
#===================START============================...
Thanks for the message.
Now i'm using :
.c.o:
$(CC) -c $(CFLAGS) $<
rather than individaul lines to declare complie. How should I add the directory information in this command?
...
hi dude543,
Thank you so much for your help!
Another question is that how to put the compiled file in a predifined directory. For example, there is a directory ./output/, and I want all the...
There are two directories /src1 and /src2 where the soruce codes are, and another directory /headers for head files.
How should the makefile set variables ( not to hard code all the...
Is it required a NULL element in the array, as it's mentioned above?
eh, make sense!
hi quzah,
Given a char**, is there any way that can find the number of elements in this char**?
Thanks!
Paul
Actually, what i did is as following,
char** aString // already assigned values by whatever way...
int i = 0;
while(aString[i] != NULL){
printf("%s", aString[i++]);
That's really cool....... :p
Hi guys,
Thanks for the mesaages. They're really helpful.
Just want to know, if I don't know the size of the array, say, I've just got a char**, rather than char*[]. how can i set the loop?
...
Hi quzah,
Thank you so much for your help.
Just a bit confused about y, what dose it refere to?
I'm quite newbi....
Paul
Hi,
How can i traverse a string array. for example, there is string array char** strings, and I just want to print every element (string) of this array.
Many thanks for your help!
Paul