Back when I first learned C++, it was 1994 - 1995. I was using MS-DOS 6.22 and Turbo C++. This was back in the time when you included all your header files with the .h suffix. You didn't use namespaces.
I probably learned about two thirds C++ and one third C, but I didn't realize it at the time. I thought it was all C++.
Even though Windows 3.1 had been out and in use for quite some time, I had no Windows experience, and I didn't have any internet experience. It was only in 1996 that I discovered the internet, Windows 3.1, windows 95, C programming, and left C++ behind.
I tried mixing C and C++ with quite interesting results. cout and printf cin and getc and such all work on different levels and speeds apparently. I would have whole sections of input and output running out of order. So, I dropped C++ because C was just so common and there was such a vast amount of program examples in C.
I have had brief occasion to revisit C++ to help friends debug homework programs, and so I'm not totally lost, but as you can probably tell, I'm far from up-to-date.
I'm not out to re-invent the wheel with my program, and I was unaware that I was doing so. Never-the-less, it serves my purposes very well.
Mainly, I'm trying to get my feet under me again when it comes to writing classes, overloading operators, using exception handling, etc and debugging C++ programs. I for one find the errors more cryptic with the C++ compilers when it comes to certain things.
I use pointers a lot in my programs, so it is intentional that I declared array and array2 the way that I did in the test program. However, I imagine this may be part of the problem I'm having with the overloaded [] operator and cout, cerr, etc. If I declared an instance of Array like this:
1 2
|
Array<int> array;
array.Size( 15 );
|
;
would accessing the index such as
cout << array[5] << endl;
Be the same as the following?
1 2 3
|
Array<int> * array = new Array<int>;
array->Size(15);
cout << array[5] << endl;
|
Or, since the second example is using a pointer, is the index needing to be dereferenced first -- something like one of the following:
1 2
|
cout << *array[5] << endl;
cout << array->[5] << endl; // This feels too much like perl programming!
|