Question:
Need help coming up with idea for C introductory programming final project for engineers?
?
2010-04-26 15:54:15 UTC
So I have a final project that I have to do for my introductory computer programming class that has to have something to with some aspect of engineering. The program has to include 3 of the following: structs, dynamic memory (malloc/free), file I/O (using fopen), and multiple files using makefile. Any ideas? Thanks!
Three answers:
tbshmkr
2010-04-26 16:23:14 UTC
Distance/Direction Calculator == Direct && Inverse

- accurate to within 0.5mm, or 0.000015″ on the ellipsoid being used.

- - - - -

Make your own file of locations (struct site with name, and structs of latitude & longitude)

Examples

- http://www.movable-type.co.uk/scripts/latlong-vincenty.html

- http://www.movable-type.co.uk/scripts/latlong-vincenty-direct.html

- - - -

Original Paper

- http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf
c0nfuted
2010-04-26 16:10:50 UTC
Linked list.



Unsorted, fixed-length data in a file [FILE I/O]. Dynamically add each record [calloc], using a linked list to "insert" records in memory [pointers].



Print the final linked list.



Put the main program, the add routines, and print routines in separate source files [MAKE].



EDIT: if you're a gluten for punishment, make the data file compatible with DBase II - IV:

http://www.dbase.com/knowledgebase/int/db7_file_fmt.htm
?
2016-12-13 08:31:34 UTC
i'm answering your different question right here, that's getting deleted i latterly introduced my homework, and between the flaws the instructor grow to be mad approximately, that's loss of comments, and stingy variable names. attempt that for somewhat, i study your code, and as an intruder, it may take diagnosis time to comprehend what your code is all approximately, the place are the preconditions and postconditions?, additionally what's that this?: //upload one to the count quantity textual content fabric document, upload one among what??? supply a proof of your purposes what they do, even whilst that's evident to you it may't be to others, and specify if the parameters won have any situations to ve shown. supply your variable names a appropriate call, don't be stingy. what's "ptrlat"? dlat dlon? a minimum of in case you wanna decide for that, make a remark explaining what those variables recommend, yet nevertheless makes perplexing to the reader might desire to undergo in ideas what those variable recommend. approximately placing apart the data employing makefile, makefile it is not something you employ and bum, you split the document, makefile that's a litte concern you write and interior it you specify how the document might desire to be compiled, enable's say you have 3 modules, and one among them has a significant function, and nicely those modules work together with one yet another i don't know, yet interior the makefile document you specify which one makes use of what and how they might desire to be joined, this is it!, the spliting is going on you, by skill of that i recommend, you ought to modularize your code by skill of announcing, ok, this purposes ought to bypass in this document reason they do issues concerning this concern, and this different purposes bypass in this document reason they are concerning this different concern. with regard to the will of use malloc and unfastened, nicely i had a foul time with those, so i'm not an expert yet study an academic i'm surprisingly specific there is a lot, that's in basic terms a thank you to shop information, you recognize that, the only concern i undergo in ideas is which you may desire to be careful, on how are you dealing with it, if a function makes use of a malloc created variable, and then it would not prefer it anymore, do not overlook to apply unfastened, otherwise there'll exist memory unused and it will in no way be deleted till you shut this technique, and this might get risky in loops, reason try to be arising countless variables with malloc, and none of them gets unfastened, and your reserved memory for this technique will blow up giving you a crash for this technique.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...