-3

When using C programming language, I have no idea how to put a user input to an array.

I need to get integers from the user in from of:

printf("Enter numbers. Separate each by a comma: ");

How can I put each number into an array?

3
  • stackoverflow.com/questions/9210528/… Commented Sep 25, 2015 at 1:36
  • Please do a basic search on this site for previous questions before posting a new one. In this case, a search for c user input to array would have turned up many matches to previous questions (and answers). Also, when asking a question, include a tag for the language you're using and the code you've written so far trying to solve the problem yourself, or at least the research efforts you've made so far to find a solution before you posted here. Thanks. Commented Sep 25, 2015 at 1:44
  • If they are comma separated use strtok and atoi. If you don't know in advance how many numbers you will also have to implement a linked list. Commented Sep 25, 2015 at 4:07

1 Answer 1

0

This is a very helpful link

Also look up this too for clarification on Console.Read & Console.Readline Difference between Console.Read() and Console.ReadLine()?

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.