Hello,
Ok.. here is another problem I have come up with..
I have a string of numbers (comma or '\n' separated (from .csv file)). I have allocated an array of integers to put in the numbers into yet how do I actually do it.
Example: I have "13, 34, 23, 12\n" string and my program should transform it into a[0]=13; a[2]=34; a[3]=23; a[4]=12
______________________________________________________________
Here are some of my ideas:
For transforming I am trying to use sscanf();
For finding what the number is (in char array format) I use a false code (works with more error then correct):
I think I did it...
______________________________________________________
//ch4n is part of this class function that retuns 1 if the char is a number or -1 //and 0 otherwise
short sn=0;
int f=0, g=0;
for (int i = 0; i<strlen(data); i++)
{
if (data[i]=='\n')
sn=1;
if (ch4n(data[i])==1 && sn==1)
{
char numb[10];
memset (numb, ' ', sizeof(numb));
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.