Mime-Version: 1.0 X-Sender: johnmeyer_1978 AT pop DOT mail DOT yahoo DOT com Message-Id: In-Reply-To: References: Date: Sun, 2 Apr 2000 11:14:40 -0700 To: djgpp AT delorie DOT com From: John Meyer Subject: Re: classes Content-Type: text/plain; charset="us-ascii" ; format="flowed" Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk >I'm new to classes, Is the anyway that I would be able to do this? > >class myClass >{ > // there would be things here >}; > >int main(void) >{ > char stuff[20]; > cin>>stuff; > myClass stuff; // I want to name it the string > // stored in stuff not the word stuff >return 0; >} >thanks Nope, not that I know of. Variable names are precompiled into the program. Besides which, you have already declared a variable with the name "stuff", so C++ will generate an error. What you are probably looking for is a map, where you can refer to variables using entered data. Those are way down the line, though, although you can look up the STL if you want.