check this code pls

I am not able to access b[i] in the for loop .



char b[30]= " initialize";



if(S==1)

b[] = "SN 2 X 0.001\r MN 2 X 1\r";

else if( S==2)

b[] = "SN 2 X 0.005\r MN 2 X 1\r";

else if(S==3)

b[] = "SN 2 X 0.01\r MN 2 X 1\r";

else if(S==4)

b[] = "SN 2 X 0.02\r MN 2 X 1\r";

else if(S==5)

b[] = "SN 2 X 0.05\r MN 2 X 1\r";

else if(S==6)

b[] = "SN 2 X 0.1\r MN 2 X 1\r";

else if(S==7)

b[] = "SN 2 X 0.2\r MN 2 X 1\r";

else if(S==8)

b[] = "SN 2 X 0.5\r MN 2 X 1\r";

else if(S==9)

b[] = "SN 2 X 1\r MN 2 X 1\r";

else

b[] = "SN 2 X 5\r MN 2 X 1\r";




for( int i=0; i< 40 ;i++)

{

char a = b[i];

xplus0.WriteByte(a);

if ( a == '\0')

break;

}
Don't post duplicate entries.
Topic archived. No new replies allowed.