I'd rather not post the exact code but I will describe it.
char stream[STORAGE];
for(;;) { /* repeat until done */
(void) printf("p2: "); ...
Type: Posts; User: yacek
I'd rather not post the exact code but I will describe it.
char stream[STORAGE];
for(;;) { /* repeat until done */
(void) printf("p2: "); ...
I'm coding a shell. . .
I have a
char *newargv[MAX];
I am able to get the newargv array to point to words when inputted in the program. For instance a user inputting "echo something 2 3"...
I agree, and thanks for the help :)
The assignment is to create three different raceways and populate them with obstacles, N = waves in Seaway, M = oil in Raceway, and O = fog in Airway. Three different vehicles on three different...
OK, will check that out. Thanks.
Any ideas for how to sort strings, check the code I commented out here it was my attempt at comparing strings. in printOrder function.
/*
My name is Jack Trocinski
*/
#include <stdio.h>
nope, that's not it.
I'm trying to get this code to print from a file data.txt which is in my c folder... it's compiling without errors or warnings, anyone see what could be wrong? As soon as I run the program prints...
might be some bugs though still... :/
This code will calculate the mode for a set of data in any range, and will return multiple modes if the set has such. For example the set: 1, 1, 2, 2, 3, 3, 4 will return you modes: 1, 2, 3 since...
WOW, finally got it to work with this code... code for the mode, for anyone doing this problem in the future obviously you need to declare everything properly in main:
for ( i = 0; i < (k-1);...
should have posted the full code, sorry bout that tabstop.. yes i did set it initially to 0 but not when found a new mode... hmmm, here is the full code anyway... going to play with it.
/*
...
Ok you guys im almost there, got the mode to work if there is a single mode in the set now I'm trying to get it to work if there are two or more modes in the set... when i enter a set like 2, 2, 3,...
Yep, so I ended up getting this code... but it only works if the set has one mode. How can I get it to work if it has more than that. Look at the code under the comment 'mode'
/*
My name...
updated code, now when i execute the code it stops after it displays the median data stored... I commented as Mode... also not sure if my mode code is correct. let me know what you guys think. There...
Also, I guess this is more of a math question let's say if we have the data set 1 , 3, 3, 5, 5
Are 3 and 5 both the mode? If so how can I account for that.
No I don't know the range of the values. I already sorted the array in ascending order, OH I see what you mean. Ok, I'm going to try working on that.
My problem is I have an array filled with some values. I need to find the mode (the number that occurs most often) of the array. I've been thinking about it for a while but no idea, maybe use a for...
I see so it needs to return a value. Ok, I'll will play around with this.
Thanks, you don't know how long that took me to figure out! :)
finally got it to work with this statement
if ( scanf("%f", &array[i]) != 1 ) break;
Hmm i thought I had it but it's still not working, doesn't break out of the loop with CTRL-Z. updated code, I added a menu since I'm going to be adding on functions later:
/*
My name is Jack...
I guess it would return a 0. Nice, I got it to work!
I've been thinking about this all day Grumpy. Still no idea how to get CTRL-Z to work.
Any suggestions, on how to use CTRL-Z to end the input?