Nice, thank you.
Im writting c++ code and its complaining about me using strcpy and strcmp.
Should I not use those? Is it risky?
Type: Posts; User: gp364481
Nice, thank you.
Im writting c++ code and its complaining about me using strcpy and strcmp.
Should I not use those? Is it risky?
Hey,
I'm trying to show all the warning messages of my c++ program, similar to a -Wall command for linux. How can I do that?
Right now I am using the command:
>: cl /EHsc myProgram.cpp
wait do i have to do "walk" through the linked list and free each node individually?
while(head){
temp = head;
head = head->nextPtr;
free(temp);
}
Cool, thank you.
I've been at it for a while and I am overcomplicating things.
Thanks again.
Hey guys,
my list is NULL in the beginning.
do I have to make a special case for when inserting the first element of the doubly linked list? I am having trouble with pointing to the previous...
it hurts ... my eyes ... !!
Way too many brackets. The way jeff formatted the code makes much more sence.
See, that was my problem. I was passing in a node with identical data but it wasnt the actual/same object as the one inside the linked list. I've now realized that it has to be the same object and...
Like i said in my post. I am working on the special case where the node to be removed is the head of the list. I am not finished with it yet. I just got stuck on how to compare nodes so I figured I'd...
when comparing two linked list elements, what exactly is compared?
The addresses?
Hey, Im trying to delete a specified node from a linked list.
I've inlcuded my whole program but the problem is in removeNode() function.
The program never enters the if statement in removeNode()
...
Okay, thank you.
Yes, you are correct. Thank you very much.
Do you care to explain why exactly that happens?
int main(void){
int size, start;
char *string = "Two words";
size = (int) strlen(string);
start = 0;
reverseString(string, start, size - 1);
return 0;
ah, I understand now. Thanks!
woot! thanks Salem. Works fine without crashes now.
I have a question though. When I do
buffer = (char *) malloc(size+1);
printf("%d\n", strlen(buffer));
Hi I wrote a program that takes a string of words and reverses the order of the words: String : two words ----> words two
The program seems to do what I intended but crashes right after...
Okay, that was subtle. Thanks guys.
Yeah, whatever[80], line[80];
Is that why it was bombing? I was trying to input NULL in the char variable?
I was just using example names. You can replace the line with whatever.
char *string;
char line[80];
char whatever[80];
while(fgets(line,80,fin) != NULL) {
string = strtok(line, "...
Okay, so if I have something like:
string = strtok(line," \n\t");
how could I copy the value pointed to by "string" into a variable of type char?
Hey, I have a quick question.
Looking at this code:
char *string;
char line[80];
strcpy(line, string);
Hey guys,
im reading a binary file and then using fprintf to write the data to a text file.
the sequence of each line is first, an (unsigned char) that determines the length of the string that...
Hey mats, Its just part of the assignment. No choice in the matter.
I have to use fwrite with a non-fixed record size.
MK27 thanks for your thoughts. I will have to do some more thinking on this. It is a pain in the butt.
Its not a problem to write to a binary file but I am having problems writting only the...