I'm trying to input these letters into and array using the following an tex

char Letters[26] = {"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"};

my complier has an error reading
too many initializers

Recommended Answers

All 2 Replies

Each item in double quotes is actually two characters, the letter you see and a null terminator ( '\0' ).

Just use single quotes around each character, like char Letters[26] = {'a', 'b', 'c',..... Please don't start new threads when you're really adding to/correcting a previous one. You could have edited your earlier one, or simply replied to it adding this better example of the problem code.

Aahh.. a double thread. I answered this already here, which kinda makes me look stupid since vmanes already answered it..

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.