hi every body...
i have problem in my project,and i need help to solve it
the problem is ::
i have string variable and i want to store two values in it
one value is string that insert it by the user and another value is integer that is generated by the system...
the problem is in the integr value how can i append it to the string??
i think ,it must convert the integr and store it in array of characters ,then append the array to the string
see my code:::
that convert the integer into array of character the number consists three digits..
is it correct or not and what is the possible solutions???
thank you...
#include <iostream>
#include<string>
#include<iomanip>
using namespace std;
int main()
{
char x[3];
int n,j=100,i=0;
cout<<"Enter";
cin>>n;
while(j>=1)
{
x[i]=n/j;
n=n%j;
j=j/10;
i++;
}
return 0;
}