little char problem

Why does my function (in VC5) give "cannot convert from 'char *' to 'char'" as an error??

void CRational::ddy ()
{
char Fc [] = {m_Numerator + "/" + m_Denominator};
printf("%s",Fc);
return;
}
dpmsAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
q2guoConnect With a Mentor Commented:
try this

void CRational::ddy ()
{  
          char Fc[] = {'0'+m_Numerator, '/', '0'+m_Denominator};
          printf("%s",Fc);
          return;
}
0
 
q2guoCommented:
since you are using VC5 why don't you try this

void CRational::ddy()
{
      String a(m_Numerator);
      String c('/');
      String b(m_Denominator);
      String Fc = a+c+b;

      cout << Fc <<endl;
}
0
 
dpmsAuthor Commented:
Ohhhhh! I knew I was doing something really stupid. Couldn't see the forest for the trees, I guess. That's you guys!!!!!
0
All Courses

From novice to tech pro — start learning today.