delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/03/19:11:55

Message-ID: <38E906CC.884416FE@geocities.com>
From: Sahab Yazdani <beyonder69 AT geocities DOT com>
Organization: PheonixSoft Inc.
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: classes
References: <eeLF4.13555$K9 DOT 107792 AT typhoon DOT nyroc DOT rr DOT com>
Lines: 38
Date: Mon, 03 Apr 2000 17:02:04 -0400
NNTP-Posting-Host: 209.5.17.203
X-Complaints-To: abuse AT sprint DOT ca
X-Trace: newscontent-01.sprint.ca 954795806 209.5.17.203 (Mon, 03 Apr 2000 17:03:26 EDT)
NNTP-Posting-Date: Mon, 03 Apr 2000 17:03:26 EDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

if you want the information contained in *stuff*.. this is the way that
you would assign myClass that value...

class myClass {
	char stuff[20];
	myClass( char newValue[] ) { strcpy( stuff, newValue ); }
};

void main() {
	myClass aClassName( stuff ); or
}

John wrote:
> 
> 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

-- 
***********************************************************
* Sahab Yazdani * "We are all who we are, no more and no  *
* Thornhill S.S * less" - al'Lan Mandragoran              *
***********************************************************
* http://pheonixware.8m.com/                              *
***********************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019