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 IamaSherpa 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: *

  1. houksyndrome

    How Do i Put numbers in arrays in order??

    I had this same problem about two days ago. qsort is what you need. This program works: #include <stdio.h> #include <stdlib.h> #include <string.h> float data[10]; float a, b; int compare(const void *, const void *); int compare(const void *a, const void *b) { float x, y; x =...
  2. houksyndrome

    sorting numbers in arrays

    I have another question. This one is about sorting numbers in an array. I want to write a program that will print out the largest number in an array. I have seen lots of threads about qsort but I'm confused as to how to use it. I have tried writing something like this. #include <stdio.h>...
  3. houksyndrome

    Dynamic Memory Allocation

    Thanks a lot everybody, I got it to work. -Andrew
  4. houksyndrome

    Dynamic Memory Allocation

    I am writing a program that reads (x,y,z) coordinates from a text file and then manipulates them. I need to store the (x,y,z) coordinates in an array. The problem is that there is a different number of points in each file, so I need to use dynamic memory allocation. I have tried using a...
  5. houksyndrome

    Simple File Manipulation

    It works, thanks for your help! Andrew
  6. houksyndrome

    Simple File Manipulation

    I had tried to write something like this, but I keep getting segmentation faults. This program might be way off of what I want to do, but I am a beginner. #include <stdio.h> main() { char name[100]; char cont[100]; FILE *thefile; (void)printf(&quot;What file? &quot;); (void)fgets(name...
  7. houksyndrome

    Simple File Manipulation

    I am a beginner programmer and have a rudimentary knowledge of C and no knowledge of the other languages. I need to write a program that will first ask the user to type in the name of the file that he wants to open, then opens that file and displays the contents on the screen. It will be the...

Part and Inventory Search

Back
Top