General Topics include: .NET Framework
Note: Most posts can be categorized into one of the forums below, where experts on that topic will be able to help you find a solution to your problem faster and more efficiently.

Go Back  Xtreme .NET Talk > .NET > General > Error about too many characters in char literal


Closed Thread
 
Thread Tools Display Modes
  #1  
Old 02-28-2003, 03:06 PM
aewarnick's Avatar
aewarnick aewarnick is offline
Senior Contributor

Preferred language:
C#
 
Join Date: Jan 2003
Posts: 1,031
aewarnick is on a distinguished road
Default Error about too many characters in char literal



char[]c = new char[]{'/', '\'};
Too many characters in character literal. What is wrong! This is frustrating!
  #2  
Old 02-28-2003, 03:24 PM
aewarnick's Avatar
aewarnick aewarnick is offline
Senior Contributor

Preferred language:
C#
 
Join Date: Jan 2003
Posts: 1,031
aewarnick is on a distinguished road
Default

Microsoft could probably have thought of a better error message.
That problem was the single backslash \ - escape character. To indicate a backslash you need \\.
  #3  
Old 02-28-2003, 04:55 PM
divil's Avatar
divil divil is offline
Banned
 
Join Date: Nov 2002
Location: England
Posts: 2,746
divil is on a distinguished road
Default

It's hardly Microsoft's fault you failed to remember that C# has escape characters in strings
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
literal quotes within a string mr relaxo Visual Basic .NET 2 01-29-2004 06:41 PM
Base-64 char array error. esmithz General 0 01-12-2004 03:56 PM
Assgning a value to a literal burak ASP.NET 1 09-18-2003 12:34 PM
Literal Question burak ASP.NET 1 09-17-2003 06:25 PM

Advertisement:







Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe