Hello!
I have some code that does not work.
What am i not doing right?
char *pointer[5];
pointer[0] = "ccc";
pointer[1] = "bbb";
pointer[2] = "aaa";
qsort(pointer, 3, 5, 1);
Hello!
Are there any function that i can use to sort a linked list?
For example in alphabetical order for a field.
Or does anyone have some code example?
Thank you.
Hello!
I get an irritating warning from the compiler:
myapp.c: 166: warning: implicit declaration of function 'strcmp'
Line 166 looks like this:
if(strcmp(listpointer->name, search->name)==0){
......
}
listpointer->name and search->name are char[100].
Whats the compiler complaining about...
Hello!
When should i use the fflush function?
When i read characters from the keyboard, from a file?
Should i call it before i call for example getchar or after?
What does it actualy do?
I have some questions.
Which of these two is the best design?
Ex 1.
int main()
{
int a = function1();
function2(a);
}
function1(){
int a;
.......
return a;
}
Ex 2.
int main()
{
function1();
}
function1(){
int a;
function2(a);
}
Are there any designpaterns or any standard...
Hello!
What is the differenc betwen malloc, calloc ond realloc?
The only thing i know is that malloc is used for alocating memory.
I have a bug in my code. The first time i use malloc everything works. But the next time at the same row the program "hangs up" at the point where i am calling the...
Hello!
I have a problem:
char[] function(){
char str[10];
strcpy(str, "Hello!");
return str;
}
int main(){
char str[10];
str = function();
}
The compiler tells me: incompatible types in assignment.
How should i do instead to get it work?
Hello!
I have problem with the function scanf.
My program looks like this:
scanf("%s", a);
scanf("%s", b);
I run it and enter the value of a.
But after that it jumps over the other scanf so that i don't get the chance to enter the value b.
I know its possible to solve the problem so i can...
Ok. Well.
I think it works like this.
When i use the functons that starts with an f.
For example fopen, fwrite, ....
The .bin file is unreadable if i open it in a texteditor.
But that does not really matter, because when i use the method fread i get the information as it looked like when i...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.