5 Discussion / Question Topics

Remove Filter
Member Avatar for SeeTheLite

So basically I'm making a generic class for rational numbers, and I want to do automatic type conversions in comparisons and operations and constructors. How would I go about doing this? Google has only returned results for template functions rational.h [code=c++] #ifndef RATIONAL_H #define RATIONAL_H class rational { public: rational(); …

Member Avatar for SeeTheLite
0
85
Member Avatar for SeeTheLite

The google references were a bit varied and ambiguos and my textbook ironically doesn't cover templates ._. if I were to make [code=c++]template <typename typ> class stk { public: stk(); ~stk(); private: struct STK { typ dat; STK *lnk; }; *chn; int ctr; }; [/code] do I have to do …

Member Avatar for SeeTheLite
0
97
Member Avatar for SeeTheLite

If I delete a pointer, does it delete the data in the current address or all of it? example: [code] bool *dat; dat=new bool; dat=true; ++dat; dat=false; delete dat; --dat; [/code] if I printed dat, would it return true or just a random address?

Member Avatar for kvprajapati
0
97
Member Avatar for SeeTheLite

Alright so I have a header file that includes another class with a pointer to a structure as a private variable. Does my second header have to be a pointer too or can it be static? [code=c++] #ifndef EXAMPLE1_H #define EXAMPLE1_H struct ex { int blah; char meh; }; class …

Member Avatar for Ancient Dragon
0
63
Member Avatar for SeeTheLite

Hey guys, I'm Kevin, hows it going? random stuff about me: Age/sex: 16/M Hobbies: reading,swimming,writing poetry,piano,games, music Musical genres: progressive rock, hardcore/thrash, techno, trance, indie, alternative, industrial, symphonic rock, classical, thug occupation:student/lifegaurd Goals(programmingwise): I'm currently learning c++ at my school but hope to expand my repetoire to include c#, java, …

Member Avatar for jbennet
0
61

The End.