Hey, I am currently trying to read a text file, which looks something like this:
1
2
3
4
.
.
a
b
c
.
.
.
I would like to read the integers and characters into the same array. I tried using a char, string.. hoping that it would be recognized as a string or something but I continuously get the compiling error "cannot implicity convert 'int' to 'string'. Does anyone know what im talking about and if so how could i get around this problem.
Thanks in advance.

Recommended Answers

All 4 Replies

Aight well i decided to manually make an array but now I am getting a few errors and I have no clue as to what i should do/am doing. could someone take a look at this lol

string[] StringLib = new string[90] { "0", "1", "2", "3", "4", "5", 
            "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i",
            "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
            "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I",
            "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V",
            "W", "X", "Y", "Z", "~", "`", "!", "@", "#", "$", "%", "^", "&", 
            "*", "(", ")", "-", "=", "_", "+", "[", "]", ";", "'", "<",
            ">", "/", ".", ";", ":","\","|" };

Im getting a few errors and im not sure if im missing something.. i dunno ive been staring at this with a blank face for a while now too. if you spot something please give me a shout.
Thanks in advance again.

It would be easier i guess to help if u could give us a clue as to what error message u r getting.
As far as the code u have posted...
Well it looks pretty OK with me...

My errors are:
Newline in Constant.
} expected
; expected
All these errors are being pointed at the end of the array.
Thanks a lot though.

Well try to use "\\" in place of "\" and it will work out...
in c# if u r using \ as a string , always make sure u follow either of the 2:
1>"\\"
2>@"\"
under this situation i would suggest u to use the first option.

i m sure the error wouldn't further come.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.