![]() |
#2
lijunbo2011-12-31 13:10
|

#include <isotream.h>
#include<string.h>
#include<stdio.h>
class MyString {
char cpBody[81];
public :
MyString & operarator++ (int i)
{
static MyString s ;
s = *this; // 这句话什么意思?什么时候需要这样做呢?
*this = (cpBody[0] == '\0') ? *this : (*this)[1]; return s ; //帮忙解释一下这句话的意思。。
void display() {printf("<%s>\n",cpBody);}
friend MyString& operator+(int i ,MyString&s);
}
#include<string.h>
#include<stdio.h>
class MyString {
char cpBody[81];
public :
MyString & operarator++ (int i)
{
static MyString s ;
s = *this; // 这句话什么意思?什么时候需要这样做呢?
*this = (cpBody[0] == '\0') ? *this : (*this)[1]; return s ; //帮忙解释一下这句话的意思。。
void display() {printf("<%s>\n",cpBody);}
friend MyString& operator+(int i ,MyString&s);
}
[ 本帖最后由 avator123 于 2011-12-31 12:44 编辑 ]