Forum: C Jul 15th, 2008 |
| Replies: 2 Views: 471 The function is malloc(), not maloc(). |
Forum: C Jun 11th, 2008 |
| Replies: 2 Views: 506 int myfunction(int argc, char *argv[]){
int i;
for(i=0;i<argc;i++)
unlink(argv[i]);
}
int main(){
int argc; // argc is not initialized to any value, what might be its value here ??... |
Forum: C May 13th, 2008 |
| Replies: 5 Views: 673 << if I try to push changed data using function, I get just the same word n times:
That happens because you are pushing pointers to one single buffer you have in your whole program, and that buffer... |
Forum: C Mar 7th, 2008 |
| Replies: 4 Views: 529 p.level is an integer, hence %d instead of %s ...
int viewcharacter()
{
printf("Name:\t%s\n", p.name);
printf("Level:\t%d\n",p.level);
} |
Forum: C Mar 2nd, 2008 |
| Replies: 48 Views: 3,315 You are having a following kind of construct, where the compiler does not know what Sort actually is inside the main() function.
#include <stdlib.h>
// Declaration of Sort commented out
// int... |
Forum: C Mar 2nd, 2008 |
| Replies: 48 Views: 3,315 Change:
qsort((void*)word, wcount, sizeof(WORD), int(*Sort)(const void*, const void*));
to
qsort((void*)word, wcount, sizeof(WORD), Sort); |
Forum: C Mar 1st, 2008 |
| Replies: 48 Views: 3,315 Just to give some basic ideas, you might do with the following simple setup, without linked lists involved at all.
Use a structure like e.g.
typedef struct
{
const char * _pWord; // pointer... |
Forum: C Feb 25th, 2008 |
| Replies: 8 Views: 1,748 Remove the & operator, tempString as such must be used in that scanf (tempString is a pointer, hence no need for &).
scanf("%s", &tempString);
Then allocate memory before copying.
temp->artist =... |