in the for loop above:
for (i=0; i<10; ++i) I assume that i is declared above the for loop, so i will still be in scope after the loop ends
Ricky
Failure is not falling down, it's staying down.
Since you included only a small snippet of code, here's a suggestion:
When you use the string class, make sure and include <string> and not <string.h>
#include <string>
using namespace std;
hope this helps. Failure is not falling down, it's staying down.
I was having a problem very similar to this with gcc 2.96.
After reading a few bulletin boards concerning this "bug", I downloaded gcc 2.95 and tried to install it. The "compile" of 2.95 failed for a variety of reasons. After being frustrated, I tried to compile my stuff...
First you should be getting 11 & 4, not 10 & 4, as the sizes of your records.
You have two different data types:
char record[10+1] // an array of 11 char's
char *record // a pointer to char's
sizeof() returns the amount of memeory that is used to store each.
The array physically...
First to answer the question:
can we use pointers to get access to private members or functions in a class?
You do not access the private members in your example, however, only the member functions of the class have access to the private data members of the class. To access the private data...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.