int main(int argc, char** argv)
{
	char c[999];
	char alpha[2[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','a','b','c','e','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
	int pos[26];
	int i=0;
	for(i=0;i<26;i++)
	{
		printf("%c\n",alpha[0][i]);
	}

}

This code is giving me an "error:exit code with return 1" and a lot of warning saying "excess elements in array initializer". I have kept searching the web and all I find is that I might have a bug with my gcc? I was wondering if anyone spotted a syntax error though because the code seemed to make perfect sense to me.--Thanks

Try this, you had a typo in your array - 'a','b','c','e','d','e','f','g' - giving you excess elements plus a few more errors

#include <stdio.h>

int main(int argc, char** argv)
{
	char c[999];
	char alpha[2][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'},{'a','b','c','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}};
	int pos[26];
	int i=0;
	for(i=0;i<26;i++)
	{
		printf("%c\n",alpha[0][i]);
	}
	return 0;
}
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.