I have a program with a subroutine that processes numbers that are input into the subroutine.
#include <stdio.h>
#include <dirent.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
float test_subroutine(float x,float y)
{
float a=105.252342562324;
float b=108.252234256262;
float d;
float e;
char var;
d=x*a;
e=y*b;
sprintf(var,"%0.2f %0.2f",d,e);
return var;
}
int main()
{
float variable[2];
variable=test_subroutine(2.5,3.5);
}
Now with this program the idea is I have either a string or variable like this:
368.386 270.63
Whether this is a string or array I want to be able to split this into two individual floating point numbers 368.386 and 270.63. How do I tweak this program to accomplish this?