English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2007-07-16 19:31:22 · 4 answers · asked by koooooooooooool 2 in Computers & Internet Programming & Design

4 answers

input a string array in the same way u do for integers.
char arr[20];
for(int a=0;a<=20;a++)
{
scanf("%c",&arr[a]);
}

2007-07-16 19:51:54 · answer #1 · answered by Suvidha A 3 · 0 1

Strait C? Not C++... boy it's been a long time!

I would recommend storing the values in a char array and then converting the result after it was all input.

#include
char line[100];
printf("Enter Binay String");
fgets(line, sizeof(line), stdin);

2007-07-16 19:47:09 · answer #2 · answered by Michael M 6 · 0 0

/* this code will promt u to enter d string until u press ENTER key.....

char ch;
char string[100];
int i=0;

while( ch != 13) // 13 is ascii value for "enter" or carriage return..
{
ch = getchar();
string[i]=ch;
i++;
}

2007-07-16 20:06:10 · answer #3 · answered by Phee B 1 · 0 0

Use cin in a for loop?

2007-07-16 19:40:03 · answer #4 · answered by Anonymous · 0 0

fedest.com, questions and answers