I have to sort 30 numbers and write the lowest 5 to a 5 element array. I don't know how to start. Thanks!
Type: Posts; User: jerrykelleyjr
I have to sort 30 numbers and write the lowest 5 to a 5 element array. I don't know how to start. Thanks!
I apologize fot the question but I need to know how can I write a piece of code that keeps track of 30 different numbers that can continuously change in value. I need to track all 30 and write the...
Thanks guys/gals....be nice.
how can I count how many names I have?
Salem you're right I copied it wrong...it looks like you said.
OK it now compiles...I had "\0". Another fubar.
I tried what you suggested and it won't compile. My array is declared as follows:
typedef struct start_info
{
char name[20];
int age[10];
}start_info;
I have a character array that I am using in a loop. The array is used to store names. I can't figure out how to clear it for the second and subsequent times when it loops. The problem is that the old...
thanks...I should have thought of it!
I'm not sure how to approach this problem. I have an array of 40 names stored in array names[40][20]. When I print the names out to a file I need to change them to a different name. Is there a way to...
Prelude it's true that there may never be 500 data pieces for each parameter...but there could be. Is there an elegant way to handle this type of situation?
Thanks!
another array question along the same line.
I have to keep track of 20 buses. Each bus has up to 20 parameters of type float that I need to keep track of. Each parameter is really a history of data...
OK Prelude. Stupid question. What if speed is an array of 500. Is this how I would declare it?
typedef struct bus
{
int ID;
float speed[500];
}Bus;
What does "fleet" do?
Thanks!
If I have a float type variable for a bus and there can be up to 20 buses to keep track of and I want to store and keep track of one float type parameter for each (speed) is it correct to have the...
Salem Thanks! I mean it.
All text is characters.
Another question. How can I check for duplicate var names when copying them into the vars array and eliminate them? I need the same var name to...
OK Salem. I need to read from a text file the following:
filename section var1 var2 ...var(n)
filename section var1 var2 ...var(n)
.
.
filename section var1 var2 ...var(n)
Note:...
OK let me restate what I need to do.
Please refer to the original post. I nee dto read lines of test from a text file. Each line contains a filename, section, and variable names.
My question...
what would you do instead? Remember I need to read multiple lines of text. Therefore the filename appears on each line as the first word. How can I accomplish what I want to do? I'm not professing...
The array is two dimensional because I need to read multiple lines of text.
The ch var is declared I forgot to cut and paste it. I apologize about the bad cut and paste job!
Yes, I know arrays...
oops I forgot to cut and paste them.
They are not the problem with the filename not getting copied into the ch and file_name variables correctly. When I run the code in the debugger and run to the...
I am trying to write a program to read a text file. The text file has the following format:
filename section varname1 varname2 varname3 ... varname(n)
There can be multiple lines of this line....
thanks hk!
I can't find a definitive answer on the proper use of "static" for declaring a variable.
I have a bool called get_data. I use it in a procedure that is declared as a "static void function_name". I...
sorry about that...it's late! thanks hunter!
hammer thanks...sorry for being so hung up on memcpy and more importantly for being a bonehead!