What can you do to an int that you cannot do to a string in C plus plus?

1 Answer

Answer :

You can perform arithmetic with it.int x {42};x *= 2; // okstd::string s {"Hello"};s *= 2; // error: std::string::operator*= (int) is undefined

Related questions

Description : How do i convert an int variable to a string in c++?

Last Answer : http://en.wikipedia.org/wiki/Itoa

Description : How do i convert an int variable to a string in c++?

Last Answer : http://en.wikipedia.org/wiki/Itoa

Description : Define a class student with int id and string name as data members and a method void SetData ( ). Accept and display the data for five students.

Last Answer : import java.io.*; class student { int id; String name; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); void SetData() { try { System.out.println("enter id and name for student"); ... (String are[]) {  student[] arr;  arr = new student[5];  int i;  for(i=0;i

Description : The Servlet Response interface enables a servlet to formulate a response for a client using the method ............... (A) void log(Exception e, String s) (B) void destroy() (C) int getServerPort() (D) void setContextType(String Type)

Last Answer : (D) void setContextType(String Type)

Description : Consider the following JAVA program: public class First { public static int CBSE (int x) { if (x < 100) x = CBSE (x +10); return (x - 1); } public static void main (String[] args){ System.out.print(First.CBSE(60)); } } What does this program print? (1) 59 (2) 95 (3) 69 (4) 99

Last Answer : (2) 95 

Description : numpy save gives error - OverflowError: cannot serialize a string larger than 4GiB -Web-Development

Last Answer : answer:

Description : SQL> SELECT * FROM MY_SCHEMA.MY_TABLE; SP2-0678: Column or attribute type cannot be displayed by SQL*Plus Why I’m getting this error?

Last Answer : The table has a BLOB column.