Is it possible to somehow grab a variable out of a string of chars? I want to grab a single integer from a string consisting of characters and numbers. Here is my current method (which isn't working). I am going to manually set the string variable here so you will know what the strings look like.
char LoadoutString = "Benelli_Close//M3-1,#M3FLSH-1
unsigned char Ammo;
unsigned char Position;
short int Loop;
ItemCount = 0;
for(Loop = 0; Loop < strlen(LoadoutString); Loop++)
if(LoadoutString[Loop] == ',')
Loop = 0;
while(LoadoutString[Loop - 1] != '/' && LoadoutString[Loop] != '/')
LoadoutName[Loop] = LoadoutString[Loop];
//This routine stores JUST the item name up to the '-'
//in my Items array, and is supposed to read the number
//right behind the '-', which is the count of the item.
for(unsigned char Parse = 0; Parse < ItemCount; Parse++)
Position = 0;
while(LoadoutString[Loop] != '-')
Items[Parse][Position] = LoadoutString[Loop];
Ammo[Parse] = LoadoutString[Loop];
//The line three lines above is my current failing method.
Am I setting this wrong or is Windoze just giving me a (%*&$@ hard time once again? I need to stick to Linux coding, lol!