-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?

Tony DiNitto
  • 1,244
  • 1
  • 16
  • 28
Xael Yvette
  • 77
  • 1
  • 9
  • http://stackoverflow.com/questions/9210528/split-string-with-delimiters-in-c – Eraph Sep 25 '15 at 01: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. – Ken White Sep 25 '15 at 01: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. – Jerry Jeremiah Sep 25 '15 at 04:07

1 Answers1

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()?

Community
  • 1
  • 1
DDJ
  • 807
  • 5
  • 13
  • 31