Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2006
    Location
    Texas
    Posts
    521

    how to reference(or point) a method? C3867 error

    I just got my retail copy of VS 2k8. and ran into a problem.

    Code:
    		case WM_PAINT:
    			hdc = BeginPaint(hWnd, &ps);
    			for(int i = 0; i < (signed)gTextObjs.size(); ++i)
    				TextOut(
    					hdc,
    					gTextObjs[i].p.x,
    					gTextObjs[i].p.y,
    					gTextObjs[i].s.c_str, < ERROR
    					gTextObjs[i].s.size());
    			EndPaint(hWnd, &ps);
    			return 0;
    I did some research and learned that for "c_str" and I need to use the (&) operator. (reference)

    Code:
    error C3867: 'std::basic_string<_Elem,_Traits,_Ax>::c_str': function call 
    missing argument list; use '&std::basic_string<_Elem,_Traits,_Ax>::c_str' to 
    create a pointer to member
    I saw a couple of examples on the msdn, and 1 from some website forum. But I haven't seen an example my situation above. What would be the syntax to reference "c_str"?

  2. #2
    Join Date
    Nov 2006
    Location
    Texas
    Posts
    521
    I got it fixed. After some forum searching at GI I saw that I need to include "()". How silly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •