Computer programmers, help me

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wedouglas
    So Fucking Banned
    • Aug 2004
    • 5921

    #1

    Computer programmers, help me

    40 C:\Documents and Settings\william\Desktop\ECE370\ass5\main.cpp no matching function for call to `strlen(std::string&)'

    wtf is this?

    I have #include <string.h>
  • Brujah
    Beer Money Baron
    • Jan 2001
    • 22157

    #2
    show the previous lines ? the one using strlen() ?

    Comment

    • Baker Rd
      Confirmed User
      • Nov 2005
      • 647

      #3
      "no matching function"

      answers your question, no?
      money talks and bullshit walks.

      Comment

      • Pete-KT
        Workin With The Devil
        • Oct 2004
        • 51532

        #4
        your calling a function that you have declared

        Comment

        • wedouglas
          So Fucking Banned
          • Aug 2004
          • 5921

          #5
          I have this

          struct stats{
          string name;
          int cost;
          };

          stats blah[2];

          how can i find the length of blah[0].name ?

          Comment

          • Pete-KT
            Workin With The Devil
            • Oct 2004
            • 51532

            #6
            where are you declaring blah?

            Comment

            • wedouglas
              So Fucking Banned
              • Aug 2004
              • 5921

              #7
              that is irrelevant. consider it in main.

              Comment

              • Pete-KT
                Workin With The Devil
                • Oct 2004
                • 51532

                #8
                whats on line 40?

                Comment

                • wedouglas
                  So Fucking Banned
                  • Aug 2004
                  • 5921

                  #9
                  just part of a conditional statement. I just need to know the function to get the length of a string.

                  Comment

                  • Baker Rd
                    Confirmed User
                    • Nov 2005
                    • 647

                    #10
                    its probably string.length or string.len (ie: length(string))
                    Last edited by Baker Rd; 11-30-2005, 04:15 PM.
                    money talks and bullshit walks.

                    Comment

                    • Brujah
                      Beer Money Baron
                      • Jan 2001
                      • 22157

                      #11
                      I think it's just being used incorrectly. Maybe this will help.
                      http://www.programmingforums.org/for...ad.php?p=43453

                      Comment

                      • wedouglas
                        So Fucking Banned
                        • Aug 2004
                        • 5921

                        #12
                        Thanks i found it. I saw it written online as length() and thought i used it like length(blah[0].name)

                        when it is actually supposed to be blah[0].name.length()

                        thanks for looking.

                        Comment

                        Working...