elwell
08-10-2003, 08:58 PM
What are the differences between C, C+, C++, and C#?
Can you use a C compiler for C+, C++ and/or C#?
And also:
I wrote my first C executable file today and a made another one that doesn't seem to work quite right. I wan to type five characters then six characters in another input then write it out diagnally but the ch11 (the last character) always gets cut off. Can someone tell me what I did wrong.
int main()
{
int ch, ch2, ch3, ch4, ch5, ch6, ch7, ch8, ch9, ch10, ch11;
printf ("Please type in five characters of your first name:\n");
ch = getc( stdin );
ch2 = getchar();
ch3 = getc( stdin );
ch4 = getchar();
ch5 = getc( stdin );
printf ("Please type in six characters of your last name:\n");
ch6 = getc( stdin );
ch7 = getchar();
ch8 = getc( stdin );
ch9 = getchar();
ch10 = getc( stdin );
ch11 = getchar();
printf("%2c\n", ch);
printf("%3c\n", ch2);
printf("%4c\n", ch3);
printf("%5c\n", ch4);
printf("%6c\n", ch5);
printf("%2c\n", ch6);
printf("%3c\n", ch7);
printf("%4c\n", ch8);
printf("%5c\n", ch9);
printf("%6c\n", ch10);
printf("%7c\n", ch11);
return 0;
}
Can you use a C compiler for C+, C++ and/or C#?
And also:
I wrote my first C executable file today and a made another one that doesn't seem to work quite right. I wan to type five characters then six characters in another input then write it out diagnally but the ch11 (the last character) always gets cut off. Can someone tell me what I did wrong.
int main()
{
int ch, ch2, ch3, ch4, ch5, ch6, ch7, ch8, ch9, ch10, ch11;
printf ("Please type in five characters of your first name:\n");
ch = getc( stdin );
ch2 = getchar();
ch3 = getc( stdin );
ch4 = getchar();
ch5 = getc( stdin );
printf ("Please type in six characters of your last name:\n");
ch6 = getc( stdin );
ch7 = getchar();
ch8 = getc( stdin );
ch9 = getchar();
ch10 = getc( stdin );
ch11 = getchar();
printf("%2c\n", ch);
printf("%3c\n", ch2);
printf("%4c\n", ch3);
printf("%5c\n", ch4);
printf("%6c\n", ch5);
printf("%2c\n", ch6);
printf("%3c\n", ch7);
printf("%4c\n", ch8);
printf("%5c\n", ch9);
printf("%6c\n", ch10);
printf("%7c\n", ch11);
return 0;
}