No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
4 Posted Topics
[CODE]execlp("some_prog", "some_prog", (char *)0);[/CODE] This is because of the exec functions replace the program running in a process with another program. When a program calls an exec function, that process immediately ceases executing that program and begins executing a new program from the beginning, assuming that the exec call doesn’t …
[code]scanf("%c", &resp);[/code] The problem is with this part of the code. When you get a prompt "Do you wish to continue? (Y/N): " you are typing in two charaters 1. 'y' 2. '\n' so the second time it prompts it is assuming '\n' as input and exiting the loop. so …
The problem is with: New = (struct node*)malloc(sizeof(struct node*)); //Here you are allocating 4 bytes of memory, sizeof(pointer) is always 4 bytes. so better use: New = (struct node*)malloc(sizeof(struct node)); //Here you are allocating memory required for the node
[code] struct node { char *data; struct node *next; }; typedef struct node* nodePtr; nodePtr newNode; ... int main(void) { newNode = (nodePtr *) malloc(sizeof (nodePtr)); //dynamically allocate [/code] In the above code there is a problem in the last line: [code] struct node { char *data; struct node *next; …
The End.
sukhmal.sena