A conversion operator which converts the current String instance into raw C-style. string oftype const char*.

A conversion operator which converts the current String instance into raw C-style. string of

type const char*.


相关考题:

下列哪个语句是声明一个含有10个String对象的数组( )?A.char str[];B.char str[][];C.String str[]=new String[10];D.String str[10];

在VB中,以下关于符号常量的声明正确的是 ( )A.Const TAG as StringB.Const TAG as String=&qu 在VB中,以下关于符号常量的声明正确的是 ( )A.Const TAG as StringB.Const TAG as String="Visual Basic"C.Public TAG as String="Visual"D.Dim TAG as String

下面的程序执行后,屏幕上显示的应是 public class Exam{ public static void main(String[]args){ char char1[]={'t','e','s','t'}; char char2[]={'t','e','S','t','1'}; String s1=new String(char1); String s2=new String(char2,0,4); System.out.println(s1.equals(s2)); } }A.trueB.falseC.testD.编译错误

阅读下列程序说明和C++程序,把应填入其中(n)处的字句,写对应栏内。【说明】下面的程序实现了类String的构造函数、析构函数和赋值函数。已知类String的原型为:class String{public:String(coust char * str = NULL); //普通构造函数String( const String other); //拷贝构造函数~String(void); //析构函数String perate =(const String other); //赋值函数private:char * m_data; // 用于保存字符串};//String 的析构函数String:: ~String (void){(1);}//String 的普通构造函数String: :String( const char * str){if (2){m_data = new char[1];*m_data = '\0';}else{int length = strlen(str);m_data = new ehar[ length + 1 ];strepy(m_data, str);}}//拷贝的构造函数String:: String( const String other){ int length = strlen(other. m_data);m_data = new char[ length + 1 ];strepy(m_data, other, m_data); //赋值函数String String::operate = (eonst String other) //{if (3)return * this;delete [] m_clara; //释放原有的内存资源int length = strlen( other, m_data);m_data = new chart length + 1 ];(4);return (5);}

在某类的公共部分有声明string operator++( );和string operator++(int);则说明A.string operator++( );是前置自增运算符声明B.string( )perator++( );是后置自增运算符声明C.string operator++(int);是前置自增运算符声明D.两条语句无区别

下列( )语句是声明一个含有10个String对象的数组。A.char str [];B.char str [] [];C.String str[]=new String[10];D.String str[10];

Operator overloading operator+= which appends another String instance into current Stringinstance.

已知String类定义如下:class String{public:String(const char *str = NULL); // 通用构造函数String(const String another); // 拷贝构造函数~ String(); // 析构函数String perater =(const String rhs); // 赋值函数private:char *m_data; // 用于保存字符串};尝试写出类的成员函数实现。

已知类 String 的原型为class string{public:string(const char *str=null);//普通构造函数string(const string other);//拷贝构造函数---string(void);string operate=(const string other);//赋值函数private:char * m-data;//用于保存字符串};请编写 string 的上述4 个函数

下列程序执行后,屏幕上显示的应是 public class Testyyy {public static void main(String[]args) {char charl[]={,'t' 'e''s],'t'}; char char2[]={'t','e','s','t','1'}; String s1=new String(char1); String s2=new String(char2,0,4); System.out.println(s1.equals(s2)); } }A.trueB.假C.testD.编译错误

编写类 String 的构造函数、析构函数和赋值函数已知类 String的原型为:class String{public:String(const char *str = NULL); // 普通构造函数String(const String other); // 拷贝构造函数~ String(void); // 析构函数String perate =(const String other); // 赋值函数private:char *m_data; // 用于保存字符串};请编写 String的上述 4 个函数。

在某类的公共部分有声明string operator++();和string operator++(int);则说明A.string operator++();是前置自增运算符声明B.string operator++();是后置自增运算符声明C.string operator++(int); 是前置自增运算符声明D.两条语句无区别

下面哪个是main()方法的合法参数()A、char args[]B、char args[][]C、String arg[]D、String args

下面的程序执行后,屏幕上显示的应是 public class Exam{ public static void main(String[]args){ char char1[]='t','e','s','t'}; char char2[]={'t','e','s','t','1',}; String sl=new String(char1); String s2=new String(char2,0,4); System.out.println(S1.equals(s2)); } }A.真B.假C.testD.编译错误

语句()能正确完成赋字符串的功能。A、chars[4];s[0]=“string”B、char*s;get(s)C、char*s[]=“string”D、char*s;strcpy(s,“string”)

Which expressions will evaluate to true if preceded by the following code?()   String a = "hello";   String b = new String(a);   String c = a;   char[] d = { ’h’, ’e’, ’l’, ’l’, ’o’ };  A、(a == "Hello")B、(a == b)C、(a == c)D、a.equals(b)E、a.equals(d)

Given that c is a reference to a valid java.io.Console object, which two code fragments read a line of text from the console?()A、String s = c.readLine();B、char[ ] c = c.readLine();C、String s = c.readConsole();D、char[ ] c = c.readConsole();E、String s = c.readLine("%s", "name ");F、char[ ] c = c.readLine("%s", "name ");

在VB语言中,下列定义变量语句格式正确的是()。A、Dim As String xuehaoB、Dim xuehao As StringC、Dim String As xuehaoD、Const xuehao As String

下面正确声明一个一维数组的是()。A、String [] aB、String a[]C、char a[][]D、String a[10]

下列哪个语句是声明了一个含有10个string对象的数组()。A、char str[];B、char str[][];C、string str[]=newstring[10];D、string str[10];

Which two create an instance of an array?() A、 int ia = new int [15];B、 float fa = new float [20];C、 char ca = “Some String”;D、 Object oa = new float[20];E、 Int ia = (4, 5, 6) (1, 2, 3)

String s= "hello";     String t = "hello";  char c[] = {’h’,’e’,’l’,’l’,’o’} ;     Which return true?()   A、 s.equals(t);B、 t.equals(c);C、 s==t;D、 t.equals(new String("hello"));E、 t==c;

Which expressions are correct to declare an array of 10 String objects? ()   A、 char str[];B、 char str[][];C、 String str[];D、 String str[10];

Given that c is a reference to a valid java.io.Console object,which two code fragments read a line of textfrom the console?()A、String s = c.readLine();B、char[] c = c.readLine();C、String s = c.readConsole();D、char[] c = c.readConsole();E、String s = c.readLine("%s", "name ");

多选题Which expressions will evaluate to true if preceded by the following code?()   String a = "hello";   String b = new String(a);   String c = a;   char[] d = { ’h’, ’e’, ’l’, ’l’, ’o’ };A(a == Hello)B(a == b)C(a == c)Da.equals(b)Ea.equals(d)

单选题Which expressions are correct to declare an array of 10 String objects? ()A char str[];B char str[][];C String str[];D String str[10];

多选题String s= "hello";     String t = "hello";  char c[] = {’h’,’e’,’l’,’l’,’o’} ;     Which return true?()As.equals(t);Bt.equals(c);Cs==t;Dt.equals(new String(hello));Et==c;