- Home /
Errors with my char array
Hello
I am trying to make a char array in C#. I looked the code up online when I got some errors with my code. The code is char[] CarName = new char[] { 'CelicaGT4', 'HondaNSX', 'NissanR34'};
I get 6 errors with this code. I get error CS1012: Too many characters in character literal 3 times and error CS1525: Unexpected symbol `' 3 times as well.
Thank you in advance
Answer by Josh707 · Jun 07, 2014 at 09:14 PM
A char in C# is a single Unicode character, 'too many characters' means you've written more than one. You would want to use an array of strings instead.
Thank you for your reply So I have to make a string array ins$$anonymous$$d. Thank you
Your answer
Follow this Question
Related Questions
Error unexpected symbol 'internal' What is wrong with this? 0 Answers
How to add colliders to an array, and pick the oldest one? 1 Answer
True False What am I doing wrong. 1 Answer
Array Utility error while building project 1 Answer
How to fix Script? error CS1525: Unexpected symbol `Internal' 3 Answers