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!
After the last fgets i get the message Segmentation fault from the operating system. What am i doing wrong?
(This is ofcaurse only a part of my application)
typedef struct mystruct
{
char a[10], b[10], c[10];
struct mystruct *link;
} mystruct;
struct mystruct* inputFunction()
{...
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.