I need to write a code in my program to convert int to string
like 1 will be USA
2 will be Australia
3 will be Canada
this is just an example actually what i need is so different...
Can anyone make a little example for me to understand?
string samplefunction(int i)
{
switch ( i )
{
case 1:
return"USA";
case 2:
return"Australia";
case 3:
return"Canada";
default:
return"None of the above";
}
}
Hey bazzy, did you mean [n-1]? I thought maybe you meant to convert from a 1 based to 0 based index. I wasn't sure why you would want use n+1 as an offset into the array. I guess it depends on the functional interface. In the getCountry function interface, what does n represent?