On Feb 9, 4:09*pm, "Bill Cunningham" <(E-Mail Removed)> wrote:

> Michael Angelo Ravera wrote:

> > I don't often post this kind of answer in a newsgroup, but it appears

> > that you are about 7 FUNDAMENTAL concepts behind in trying to tackle

> > C.

>

> > 1) Understanding Memory sorage

> > 2) Fundamentals of data representation

> > 3) Different forms of arithmetic

> > 4) Organization of functions

> > 5) Use of operations

> > 6) Fundamentals of recording persistent data

> > 7) Appropriate file type selection

> > Fundamentals of logic

>

> * * Oh boy I know there's different kinds of math but not different kinds of

> arithmetic. If you mentioned recursive functions to me I would think of 1..

> f(x) 2. a function that calls itself. But that's just about it.

>

> Thanks Mich.

>

>

>

> > My suggestion is that you do an online "Crash Course" before you ask

> > for help again or post another message to this thread (Except to say

> > "Thank you, Mich!")

>

> > People on this forum are very willing to help, but they can't teach

> > you the language or all of its fundamental concepts that are

> > considered prerequisites to attempting your first program in C.- Hide quoted text -

>

> - Show quoted text -
As re #3: whats 20000+30000? Using 16-bit signed arithmetic, the

answer is either "It's illegal" or "-17232" (not 50000).

What's 19/5? Using integer arithmetic, the answer is "4" (not 4.

.

As re #2? What is the most appropriate representation of a date? Well,

that depends upon whether you are going mostly to be just displaying

it or whehter you are going to be sorting with it or whether you might

want to caluculate with it.

If you are mostly just displaying the date, then whatever format

people who are using the program prefer to see the date is most

appropriate. "Friday, February Tenth Twenty-Eleven" would be just

fine, if your people like to see the date that way.

If however, you want to sort by it so that later dates occur before or

after earlier ones, depending, then you want to do something like

"20110210" (adding hyphens or slashes is OK, provided you always

include the zeros or use a leading space for mothns or days less than

10). You could have three different fields for year, month, and day in

that order, if you want.

If, in the third case, you might want to be able to calculate the

differences between the dates, you should either use the Julian Date

(number of days since the calendrical convergence) or take the number

of seconds since 1970 (or other convenient date) and either use it or

divide it by 86400.

In the last case, you have to use or find a function that shows the

dates for human consumption in a meaningful format and one that allows

input from humans in a convenient format (A date picker gadget?)

As re #1 (sorry for the typo), you need to understand how memory

storage is organized so that when you aggregate the data into a struct

and attempt to persist it, you will know what you are getting, so that

you can interpret the data that you retrieve from a persistent store

in the same way that you meant it when you persisted it.