Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: mattias1975
  • Content: Threads
  • Order by date
  1. mattias1975

    qsort

    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);
  2. mattias1975

    ipconfig in unix and linux?

    Hello! Is there something similar to ipconfig(windows) in linux and unix that i can use to get the ip address of my computer?
  3. mattias1975

    Array of pointers

    Hello! Whats wrong with this? char *pointer[10]; strcpy(pointer[0], "hello"); printf("%s", pointer[0]); Thank you
  4. mattias1975

    Decide if a number is devidable with 2

    Is there any function in c that decides if a number is devidable with 2 or not?
  5. mattias1975

    Sort a linked list

    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.
  6. mattias1975

    warning: implicit declaration of function 'strcmp'?

    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...
  7. mattias1975

    The fflush function

    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?
  8. mattias1975

    Returning char[]

    Hello! How do i return a char[] from a function? Do i have return a pointer to it? A smal example code would be nice. Thank you.
  9. mattias1975

    Code design

    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...
  10. mattias1975

    malloc, calloc and realloc

    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...
  11. mattias1975

    Problem with returning char[] from function

    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?
  12. mattias1975

    Segmentation fault

    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() {...
  13. mattias1975

    Questions about free()

    Hello! Is there any rule when to use the function free()? Some times when i use it i get the message "Segmentation fault" from the compiler. Why?
  14. mattias1975

    Bit operator

    Hello! I have a question. What is the bit operator good for? What is the most comon task to perform with it? Thank you
  15. mattias1975

    Problem with scanf

    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...
  16. mattias1975

    Problems with writing to a file

    My program is supposed to write some char[] in a struct to a file. It works but the program also add some other crap characters to the file that i dont want to have. Why? And how do i fix it? Thak you. The program looks like this: FILE *reg; reg = fopen("/home/cproject/register.dat","w")...
  17. mattias1975

    Clear the screen in ansi c.

    Hello! Does anyone know how to clear the screen in textmode in ansi C? I am not allowed to use clrscr() in the conio.h file, because it is not a part of ansi C. Thank you
  18. mattias1975

    Sending binary files

    Hello! Does anyone know how to send binaryfiles(.exe) with sockets? Not text files. Thats easy. I already know how to do that. Some example code would be great. Thank you.
  19. mattias1975

    TransmitFile

    Does anyone know how to use the socket function TransmitFile? An example would be nice. Thank you.
  20. mattias1975

    TransmitFile

    I need to know how to use the socket function TransmitFile? An example would bee nice. Thank you.

Part and Inventory Search

Back
Top