I
insirawali
I have written this in C#.
I just need to convert it into C.
da problem comes when handling the String. In C the String doesn't
behave the same way as in C#.
it would be great help if smeone cn help me out to make the string
work on the same way as in C# (for this code.).
private void Caller()
{
Int32 a = 5;
partation(a, a, "");
}
private void partation(Int32 n, Int32 m, String s)
{
Int32 i;
if(n>0)
{
for (i = Math.Min(n, m); i > 0; i--)
partation(n - i, i, s + i.ToString()); // the
problem comes here.....
}
else
{
Console.WriteLine(s); //This can be put as a Printf
}
}
I tried using sprintf, strcat, but no use, it prints some garbage
values (may be im not using them correctly). pls pls help me..........
Insira
I just need to convert it into C.
da problem comes when handling the String. In C the String doesn't
behave the same way as in C#.
it would be great help if smeone cn help me out to make the string
work on the same way as in C# (for this code.).
private void Caller()
{
Int32 a = 5;
partation(a, a, "");
}
private void partation(Int32 n, Int32 m, String s)
{
Int32 i;
if(n>0)
{
for (i = Math.Min(n, m); i > 0; i--)
partation(n - i, i, s + i.ToString()); // the
problem comes here.....
}
else
{
Console.WriteLine(s); //This can be put as a Printf
}
}
I tried using sprintf, strcat, but no use, it prints some garbage
values (may be im not using them correctly). pls pls help me..........
Insira