1

I want to take input as

9.30 9.45 14 16

11 14 15 16      // in two separate lines

The size of the array is not given. I want to take these input from keyboard and put into two separate arrays and then perform some operations.

Note: Input is of two lines only and if we press enter after first line, then it should go to next line and then terminate.

Ziezi
  • 6,375
  • 3
  • 39
  • 49
arceus
  • 327
  • 4
  • 15

1 Answers1

0

The built-in function strtok() to split a given string into tokens might be what you need. Check here: Split string with delimiters in C

EDIT: Apparentely, strtok has been deprecated: http://www.manpagez.com/man/3/strsep/

Community
  • 1
  • 1
Bruno Oliveira
  • 735
  • 10
  • 20