Mail Archives: djgpp/1998/11/13/13:30:19
Message-ID: | <364C768F.BF94B96A@nceye.net>
|
From: | sabrh <sabrah AT nceye DOT net>
|
X-Mailer: | Mozilla 4.5 [en] (Win95; I)
|
X-Accept-Language: | en,ru
|
MIME-Version: | 1.0
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | first class
|
Lines: | 52
|
NNTP-Posting-Host: | 206.107.98.65
|
X-Trace: | news14.ispnews.com 910980841 206.107.98.65 (Fri, 13 Nov 1998 13:14:01 EDT)
|
NNTP-Posting-Date: | Fri, 13 Nov 1998 13:14:01 EDT
|
Organization: | ISPNews http://ispnews.com
|
Date: | Fri, 13 Nov 1998 13:12:31 -0500
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
Hya,
yes, this is my first class.
I'm a freshman and CS minor. It wasn't an assignment to write a class.
I ve done assignment without classes, but wanted try classes. Well, it
works, but it gives me warning (gcc)that functions containing for are
not expanded inline.
I was reading bout inlining functions, but can't see how can I apply it
here?
Any explanations will be greatly appreciated.
Also, when I link in graphics.lib it messes up int convertions....What's
the solution..
I'm switching my ISP.. Please post here or send to iakovlev AT mailcity DOT com
#include <iostream.h>
class Dorit{
char line[80], x;
public:
int lin[80], k, j, y;
int thinking(){
cout<<"Please enter a character string."<<endl;
cin.getline(line, sizeof(line));
cout<<"Now Enter a character u want to be counted."<<endl;
cin>>x;
y=x;
for (k=0; k<80; k++)
lin[k]=line[k];
j=0;
for (k=0; k<80; k++)
{
if (y==lin[k])
j++;
}
cout<<"The thing was "<<j<<" time(s)."<<endl;
return 0;
};
};
main()
{
Dorit blushing;
blushing.thinking();
return 0;
}
- Raw text -