yeah I found the exact place where it starts happening in my program. here is the code : (in runable form ) !beware messy code!
Code:
#include <iostream.h>
#include <conio.h>
#include <string.h>
const string SKILL_LIST ="Bladecraft,Knife";
int main()
{
string req[5];
string temp;
for (int a=0;a<5;a++)
req[a]="\0";
int x=0;
int pager=0;
int y=0;
clrscr();
cout << 100 <<endl;
do
{
cout << 100 <<endl;
while((SKILL_LIST[x+pager]!=',')&&
(SKILL_LIST[x+pager]!='\0'))
{
temp[x]=SKILL_LIST[x+pager];
x++;
cout << 100 <<' ';
}
cout <<'\n';
if (SKILL_LIST[x+pager]==',')
{
cout << 100 <<' ';
x++;
pager=x;
x=0;
while (x<pager)
{
cout << 100 <<' ';
req[y]=req[y]+temp[x];
x++;
}
cout <<'\n';
req[y]=req[y]+'\0';
temp=req[y];
req[y]=temp;
x=0;
y++;
temp[0]='\0';
}
else
{
cout << 100 <<' ';
int a =0;
int trash=pager+x;
while (trash>pager)
{
cout << 100 <<' ';
req[y]=req[y]+temp[a];
pager++;
a++;
}
cout <<'\n';
req[y]=req[y]+"\0";
}
}while (SKILL_LIST[x+pager]!='\0');
cout << 100;
getchar();
return 0;
}//end main
The code works exactly the way it should ie
req[0]=Bladecraft
req[1]=Knife
was going to change this code to something else but now i'm curious as to why it does this...
the cout's were added to show the output