Thanks Quzah. That really really helps. I rewrote my insert_database function, implementing what you suggested. Here's what I ended up with:
void insert_database( struct Database * db, struct...
Type: Posts; User: michael-
Thanks Quzah. That really really helps. I rewrote my insert_database function, implementing what you suggested. Here's what I ended up with:
void insert_database( struct Database * db, struct...
Hi,
I know this is late, but it's on this same topic. Your assistance so far has been really great.
I'm stuck on validating the "location-to-insert" in the list. Here's what I have:...
Some of the code provided by my teacher makes me doubt what I'm doing (not that I was ever sure):
for( i = 0; i < db->ncountries; i++ )
{
delete_country( db->list+i ); // free mem alloc to a...
Well, that's where I'm stuck. I dynamically allocate (with calloc) the space needed for my array of country structures:
db->list = (struct Country *)calloc( countries, sizeof( struct Country )...
I don't get one. It inserts one country at index 2, and then it stops (I have 4 countries to be inserted).
I can't really make that description any simpler. I need help accessing a certain element of a dynamically allocated array of structures, and my only access to the array is a pointer contained in...
Hi,
I'm trying to convert an int to a char, just to see if the value entered is a alphabetic character. Here's what I have in my method:
void FillUserArray( int userArray[], int arraySize )
{
...
I did check out the sorting tutorials on cprogramming.com, but I found them to be very unhelpful (my comprehension level is below that of someone who will make it in the programming world, but I'ma...
I've got an assignment that requires me to use selection sort in descending order, and here's my code so far:
void SortRecord( float grades[] )
{
int i, j;
int min, temp;
for( i =...
Thanks spydoor, that was the formatting I needed. And thanks to everyone else who added their input. I learned more with this one than any of the other labs. :)
spydoor, I agree with you entirely. The way the input file was given to me, with all these jumbled up spaces and with a poor description, was confusing at best.
What you provided is a great...
That'd be going against the rule of the lab, and in either case, I still don't know how to read a space versus an entire float (switching between %c or %f).
One final question, and it's to do with formatting this input file into an output file. Here's the code so far:
/************************
* CIS 15AG AM - Lab VII
*
* A program to help a...
Thank you all so much. That's really helpful. I'm sure I'll be back with more questions (and I think I know why - after rereading the assignment, it's written very poorly, but my professor is a CIS...
Hrm. I've been battling this one again for a while. I dont understand why I'm so baffled by this, but I need support again. Here's what I have so far:
/************************
* CIS 15AG AM -...
I see. So fscanf( ... ) doesn't go back to the start of the line if the call to the function ends? That's helpful info. Thanks, I'll get back to giving it a shot :)
Unfortunately, I'm not allowed to use arrays at all :/
Would your suggestion be like this (I apologize for not testing first, but I dont have an IDE at hand here):
fscanf( input,...
Hi :)
I've been perusing the board here for a couple weeks, and have found it to be a great resource in learning C and C#. However, I can't find any answer to my current problem, which is part of...