Perfect. Easy solution. Exactly what I needed. Thank you!
Type: Posts; User: joatmon
Perfect. Easy solution. Exactly what I needed. Thank you!
I have a program that spawns a number of threads. Each thread generates a table of output. During the time that it is creating this output, I don't want the other threads to be outputting, so I've...
Thanks. I tried that method many times, but never successfully. I'm giving up. Linked lists hurt my brain. Arrays here I come.
Thanks. How then do I create a new node that will survive beyond the scope of the current iteration? I'm very confused.
Here is a way that I have done this:
char* serialized = malloc(3*sizeof(int)); // allocate enough memory to store your entire struct
bzero (serialized, 3*sizeof(int)); // or use memset...
I have a singly-linked list. I am confident that I have the list set up and the data populated. However, when I go to print out the contents of the list, I'm not able to traverse it.
int...
Ack! Thanks.
I have an input file that contains any number of lines. Each line will follow the same structure. There will be 5 fields, separated by 4 commas. Fields 1 and 3 will be single characters, fields 2,4,5...
Thanks. That works. Finally. I guess that I'm confused as to when I have to call malloc and when I don't. A couple of posts ago, I thought you told me that I needed to call malloc after my function...
This is killing me. A simple string concatenation. Unbelievable.
filename = "client/";
fprintf(stderr, "filename: %s\n", filename);
char* temp = get_filename(selection);...
Wow, I didn't know that. I usually program in Java, and we do this all the time. But what's wrong with this:
filename = "client/";
fprintf(stderr, "%s\n",...
Thanks. I understand what you are saying. But then I try this, and I still get a segmentation fault:
char* temp;
temp = malloc(strlen(get_filename(selection))+1);
strcpy(temp,...
I have a function that returns a char*. No problem. But I need to concatenate another array with the results of this function. I'm getting a segmentation error.
What am I doing wrong? Thanks.
...
Just simply trying to capture the command line inputs, but I get a segmentation fault:
fprintf(stdout, "host: %s\n", argv[1]);
fprintf(stdout, "sizeof: %lu\n", sizeof(argv[1]));
...
Thanks!
I have a character array that will have a prefix and then a filename that will be between two square brackets. Something like this;
get[filename]
I need to isolate the characters between the...
Is there anybody who can answer this question? I appreciate his help, but he did not really attempt to answer my question. All he did was tell me that it did'n't matter. I am quite sure that gdb can...
It's not inlined. I got it to work by writing it in a different function. No idea why it worked in one place but not in the other. Thanks for your help.:)
I'm putting this in the gdbinit file. I appreciate your help, but I respectfully ask that you limit your response to answering my question, not spinning me around in circles like so many do on these...
Can't. I'm programming this, and the line number changes all the time.
Can anybody tell me how to set a breakpoint in gdb on a function that returns a pointer? I know that for foo():
break foo
will take care of it, but what if I have
void *foo()
I...
Thanks. When I call other functions, it seems to work. There is something about the one that I am trying to call that isn't working out. Too much code to post here. I'm probably overlooking something.
I working in GDB to debug my program. At various breakpoints, I want to call a function that I wrote that iterates through my heap at that point in the execution. I have seen that I can call this...
I'm trying to decipher some assembly code and have come across these two lines:
test %ebx,%ebx
je 8048e04
%ebx holds the value 0x804c600, which in turn holds the value 0x24.
What I think...
Thank you, BigH. That helps. I was doing my shift before converting to binary, which was screwing everything else up. I appreciate your help.
iMalc: While I appreciate any help offered to a...