compile error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Barbara Baby
    New Member
    • Oct 2011
    • 21

    compile error

    Hi, I have tried to compile this program but there is warning:

    //argumented constructor
    //initializes string array with passed argument
    MyString::MyStr ing(const char* s)
    {
    int len = strlen(s);
    if(len <= StringCapacity) //size <= 80
    {
    strcpy(StringAr ray, s);
    StringSize = len;
    }
    else //size > 80
    {
    int i;
    for(i=0;i<=Stri ngCapacity;i++)
    StringArray[i] = s[i];
    StringArray[i] = '\0';
    StringSize = StringCapacity;
    }
    }


    warning: incompatible types in assignment of int to char.
    Please help fix this, thank you very much
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    at what line?????...... ...............

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      You will need to post your class definition.

      Comment

      Working...