I am trying to use sscanf to print out only the numbers in a string of characters. Here is my code so far, but I get a segmentation fault when i run it.
#include <stdlib.h>
#include <stdio.h>
int main() {
char storage[100];
int n=0, numbers;
while( storage[n] != EOF ) {
gets(storage);
sscanf(storage[n], "%lf", &numbers);
printf("%d\n", numbers);
n++;
}
}
I cant seem to find the error in this code, please help me!