Ask your own question, for FREE!
Computer Science 6 Online
OpenStudy (anonymous):

In c++, How do you make a function to ask the user input, and then store that input? It would ask 3 different chars, and store them?

OpenStudy (anonymous):

use an array for the storage, and a for/while loop to ask the user repeatedly three times to input something into the array. do you need further help?

OpenStudy (anonymous):

@Shadowys Can you post an example? The way I have it set up is not working

OpenStudy (hunus):

#include <stdio.h> #include <stdlib.h> int main() { char entry[3], i, k; for(i=0; i<3; ++i){ int c = getchar(); int t = c; if ( c == '\n' ) { i -= 1; continue; }else{ entry[i] = t; } } for(k=0; k<3; ++k){ printf("%c ", entry[k], "\n"); } system("PAUSE"); } Something like this? (This is in C)

OpenStudy (hunus):

Something that takes 3 character inputs and saves them?

OpenStudy (anonymous):

@hunus yes,

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
15 hours ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
18 hours ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Arizona: does anyone know the percentage rate of 30,000 and 40,000
1 week ago 0 Replies 0 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!