I have the following input:

```
1 (2 ,3 ,4) lantern

```

The number of int inputs between the parenthesis is unknown, and could extend for a while.

My original thought was to scanf() the first int, then create a while loop to determine when the closed paranethsis is scanned. Then finally use fgets() to get the string at the end, something similar to this.

```
scanf("%d", &address);  //first input

scanf("%c", &paren);    //scan the '(' or ',' or ')'

int current_room = 0;   //index for array inside parenthsis

while(paren == '(' || paren == ','){

    scanf("%d,", adjoined_room[current_room]);  //scan am int

    scanf("%c", &paren);   //scan a ',' or ')'

    current_room++;        //increase the index

}

```

This however prints the following output when I print my address, array, and string:

```
Address: 1
Item: (2 ,3 ,4) lantern

```

The inputted ints between the parenthesis were never set to the array. Is there a better way to determine when ')' is inputted?