C Programming

  kentylad 16:36 26 Nov 03

I have a question which to be honest, I wouldn't have thought could have been answered here.

It's a programming question, and would want to know whether anyone could answer it or whether I should ask it elsewhere i.e. a programming forum.

Any suggestions?


  spikeychris 16:42 26 Nov 03

Why not ask the question Nick and see.

  kentylad 16:48 26 Nov 03

Well I wanted to know wether anyone had any knowledge of C.........no point in typing out my problem if no-one can answer it (!)

Anyhow, seeing as you're asking i assume you know a thing or two Chris?

Well, I have written a simple program which will calculate various mathematical functions such as the mean and standard deviation, of a number of values read in from a file (using FILE POINTER)

I have successfully done this within the main function, and would not like to include any other functions other than this. I hvae been having trouble with how to print out the 'largest' and'smallest' numbers read in from the file i.e. if the file contained -1 2 -7 4 8:

Largest = 8
Smallest = -7

I also haven't used arrays



  spikeychris 16:51 26 Nov 03

Think the overhead grommets gone and the reversible flange is damaged.

  tbh72 16:58 26 Nov 03

Starts to reference Deitel & Deitel, bear with me, but I suspect you need to include a sort command?

  kentylad 17:05 26 Nov 03

"Think the overhead grommets gone and the reversible flange is damaged."

ummm............nice one (!)

  R4 17:11 26 Nov 03

When you've read the file do you get a result returned from your function like 'Largest = 8 Smallest = -7' if so use one of the (s)printf functions to print out 'Largest','Smallest'

  tbh72 17:11 26 Nov 03

click here

I wont pretend to be a C expert, I have provided a link to the deitel website d/l area, scroll down the page where you will find downloadable C examples. You should be able to extract a solution from the examples provided.

Sorry I couldn't be more help?

  spikeychris 17:12 26 Nov 03

Sorry, not a clue. What I know about C could be written on a fag packet. But it got someone on the case.........

  kentylad 17:18 26 Nov 03

This is literally what it does; opens the file, reads the data from the file but doesn't return anything.

The program uses the values read in to calculate the mathematical functions etc


  kentylad 17:20 26 Nov 03

This is what i want to do! I want something to return 'Largest' and 'Smallest'

This thread is now locked and can not be replied to.

Sniper Elite 4 review: Headshotting Nazis has never felt so good

1995-2015: How technology has changed the world in 20 years

The Best Design, Illustration, Animation and VFX Awards of 2017

WWDC 2017 dates: How to get WWDC 2017 tickets, when is WWDC 2017 and more details announced