answersLogoWhite

0


Best Answer

Well, if you write like char a=string; it is wrong. You have to declare the size of the array or else put the brackets immediately after the variable declaration. You also have to put the string in quotes, or provide a comma-separated list of characters. E.g.,

char a[]={'s','t','r','i','n','g'};

Or more simply:


char a[] = "string";

Remember that C/C++ is case-sensitive and that all keywords are lower case. Thus Char would be regarded as an invalid keyword.


User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between Char a equals string and char a equals String?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the difference between a C plus plus string and a C-style string?

A std::string is an object that encapsulates an array of type char whereas a C-style string is a primitive array with no members. A std::string is guaranteed to be null-terminated but a C-style string is not.


What is difference between String str and String s equals new String?

The first statement, "String str", simply declares a variable named str of type String. It does not allocate memory or assign any value to the variable. The second statement, "String s = new String", declares a variable named s of type String and allocates memory for it. It also creates a new instance of the String class and assigns it to the variable s.


Is string a standard java class?

No. A String is handled as an Object. In many cases you can treat it as primitive (and forget that it is an object), but sometimes the difference is relevant. The class is called String - note that it starts with an uppercase "S".One case where it is important to know that a String is an object is when comparing strings. You can't simply use the ==operator; instead, you have to use the .equals()method.No. A String is handled as an Object. In many cases you can treat it as primitive (and forget that it is an object), but sometimes the difference is relevant. The class is called String - note that it starts with an uppercase "S".One case where it is important to know that a String is an object is when comparing strings. You can't simply use the ==operator; instead, you have to use the .equals()method.No. A String is handled as an Object. In many cases you can treat it as primitive (and forget that it is an object), but sometimes the difference is relevant. The class is called String - note that it starts with an uppercase "S".One case where it is important to know that a String is an object is when comparing strings. You can't simply use the ==operator; instead, you have to use the .equals()method.No. A String is handled as an Object. In many cases you can treat it as primitive (and forget that it is an object), but sometimes the difference is relevant. The class is called String - note that it starts with an uppercase "S".One case where it is important to know that a String is an object is when comparing strings. You can't simply use the ==operator; instead, you have to use the .equals() method.


What is difference between System.String and System.StringBuilder classes?

String and StringBuilder classes are used to store string values but the difference in them is that String is immutable (read only) by nature, because a value once assigned to a String object cannot be changed after its creation. When the value in the String object is modified, a new object is created, in memory, with a new value assigned to the String object. On the other hand, the StringBuilder class is mutable, as it occupies the same space even if you change the value. The StringBuilder class is more efficient where you have to perform a large amount of string manipulation.


How do you find out not equals string in java?

Remember that strings are objects. You can use the String.equals method to determine equality, and use the ! (not) operator to test for inequality. public static boolean notEquals(String str1, String str2) { return !str1.equals(str2); }

Related questions

What is the difference between x equals 3 and x equals equals 3?

The second would suggest that x equals the string "=3".


Difference between character and string?

A string ends with a '\0' character,but character is not.


Whats The difference between a 6 and 7 string guitar?

There is practically no difference. The 7-string guitar has one lower string that the 6-string does not. It is usually tuned to B(natural).


What is the difference between rope and string?

The difference between thread rope and string is that thread is more thicker than string and that string is more thinner than rope and thread is more thinner than rope there's your answer geese


What is the difference between thread rope and string?

The difference between thread rope and string is that thread is more thicker than string and that string is more thinner than rope and thread is more thinner than rope there's your answer geese


Difference between thong and g-string?

g string only has a string in the back thong has triangle of fabric g string= T thong = Y


What is the difference between string and class?

A string is a specific class that is used for dealing with text data


What is the difference between A and A in string?

Well, A is an identifier; 'A' is a character-literal; "A" is a string literal (of 1 character); "'A'" is another string literal (of 3 characters).


Is there a difference between leather and string when weaving?

yes


What's the difference between violins and violas?

Violas are bigger in size and have a low C string and not a high E string. The violins have the high E string.


What is the difference between a C plus plus string and a C-style string?

A std::string is an object that encapsulates an array of type char whereas a C-style string is a primitive array with no members. A std::string is guaranteed to be null-terminated but a C-style string is not.


What is the difference between an ernie ball slinky string and a super slinky string?

super slinkys are easier to bend notes on