asked on
ASKER
ASKER
ASKER
ASKER
ASKER
C++ is an intermediate-level general-purpose programming language, not to be confused with C or C#. It was developed as a set of extensions to the C programming language to improve type-safety and add support for automatic resource management, object-orientation, generic programming, and exception handling, among other features.
TRUSTED BY
#include<stdlib.h>
char input[100];
int num[100] , i=0;
freopen("input.txt","r",st
gets(input); //read the line
input[0] = input[strlen(input) - 1] = ' '; //erase brackets
char *p = strtok(input,","); //tokenize the string at comma ","
while(p != NULL) //for all token
{
num[i++] = atoi(p); //convert to integer and save
p = strtok(NULL,","); //next token
}
this will store all the integers into num[] array