I need help on an English project please!!

Status
Not open for further replies.
I never did C++ but I did take a java programing class in college how in the world you not use string when writing code? In our most basic program it still had to have string in it.

Because in C/C++, there's really no such formal native contept of "strings" per se.

There is, however, the convention that a null terminated array of char is perfectly usable for stringlike purposes. ;)


From this notion came a bunch of std lib functions, which would do perfectly horrifying things to regions of memory that did not happen to contain null terminated arrays of characters intended for stringlike purposes. :neener:


Like Navy nuclear reactors which have no safety mechanisms, and which allow the operator to perform "career limitting operations", C presumes that if you wrote 10,000 bytes past the end of the array overwriting the code segment you're executing, well, you must have had a good reason for doing that.
 
There is, however, the convention that a null terminated array of char is perfectly usable for stringlike purposes.

From this notion came a bunch of std lib functions, which would do perfectly horrifying things to regions of memory that did not happen to contain null terminated arrays of characters intended for stringlike purposes.

Which may be precisely why a teacher would not want students using the std lib functions. He may have wanted students to wrestle with the issues related to the lack of true strings in C.

It was a reservation record maintenance thing. Without struct.

He got there, but it became a mess of parallel arrays and stuff.

When the problem was more fully explained as a database problem, I could also see why the professor may not have wanted students to use structs. If he wanted them to build a relational database, and wrestle with those issues, he very may well have wanted to force them to use lots of parallel arrays.

Then you'd learn that was a struct in C could be implemented as a set of relations in a database. Since I have been working so long in C, it would driver me buggers to try to program without structs, but it might be a useful exercise. If you had structs, you'd use them, and you wouldn't learn how to build the equivalent of a struct out of a bunch of relational operations

Mike
 
Status
Not open for further replies.
Back
Top