Okay - thank you
Type: Posts; User: dmkanz07
Okay - thank you
That was helpful Dave. Now I still do not understand how C opens a binary file, extracts a specific field and then sorts it but that field. Again I think understand how C is comparing the values...
Here is my original sort program for a text file I created manually
#include <stdio.h>
#include <string.h>
/* Function main begins program execution */
int main()
{
Okay - I am trying to select the element but when I try to scan in the elements I am not sure if the syntax is right
/* Load horseData with default information */
struct horseData sortHorse...
Quzah
I am not trying to be a pain but I dont understand how in the array I can sort the structure.
My program has the user enter in a horse and it attributes
i.e
name, date of birth,...
I am not even getting to the sort - it crash at the while piece of the code. Any ideas why
Thanks
DMKanz07
I thought my post was broken down.
Thanks
DMKanz07
Hello all,
I am working on a project and I am having some difficulties sorting. I am trying to read in from a binary file and sort the structure but I am not sure I have it setup correctly. Any...
Thank you
Is there a way in C to clear the screen in a console application? I would like to clear the screen everytime my main menu pulls up
Thanks
DMKanz07
Okay guys I went a different direction. But I have a question about using a binary file. If I want to create horses.dat what format do I need to delimit the individial strings.
Here is my code
...
Sorry about that I was focusing so much on the while loop I didnt check my syntax.
Here is my code after checking it. It compiles but I get a windows error when I try to run it. Exer1_w8b.exe...
Okay I tried this but when I compile I get a parse error. I am trying to take the records in horses.txt and pass them to the structure horse and then print the structure to make sure it is passing...
I hope I am explaining this right (noob)
What I am trying to do is read the data from a file into the structure defined as horse.
So what I did is defined the structure
typedef struct {
...
Hello everyone,
I am writing a program that use structures and I have a couple questions. First if I am reading the data from a text file in to an array of structure how is the data laid out in...
Nadroj,
I am but I just trying to get one word to work first. Dang I know == compares dont know why I used =.
C is still very new to me, i should say programming is new to me
Thanks for...
Okay I have been trying to figure out how you test to see if the last to character are equal to 'ed' and I am stumped
I tired
if ( secondLast = "e" && last = "d" )
printf( "%c\n", s...
Okay I am stuck on how i can read a series of strings and print only those strings that ended with the letters "ed"
Here is what I thought I could do is find the length of the string and the...
Hello Everyone,
Is there a command that will print only certain characters. I am looking at the strstr command but not sure if this is right.
What I am trying to do is have the user enter a...
What is the difference between gets and fgets? I found examples of fgetc but not fgets ( Deitel C how to program ).
DMKanz07
Does toupper only convert one character at a time?
Thanks
DMKanz07
Hello everyone,
I am working on a problem and I am not sure of the syntax for the toupper command. What I am trying to solve is when a user enters a string of characters C goes out and changes...
would the syntax be fopen ( "%s", filename, '"r" )...
Thanks
DMKanz07
/* Fopen opens file; exits program if file cannot be opened */
if ( ( cfPtr = fopen( "unsorted_file.txt", "r" ) ) == NULL ) {
printf( "File could not be opened\n" );
} /* End if */...
Thanks Quzah and Koni
I will attempt writing the function prototypes and post what I come up with.
Thanks again for all the help you guys are awesome
DMKanz07