CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Jul 2003
    Posts
    6

    array character to character

    Code:
    #include <stdio.h>
    #include <string.h>
    
    main()
    {
    
    const char *temp="hello";
    const char *string="how";
    
    	  printf("%d",strcmp(temp[0],string[0]));  
    
    }
    The code gave me the following warning msg.

    c:\documents and settings\winson\desktop\data structure\forum.c(10) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'const char '
    c:\documents and settings\winson\desktop\data structure\forum.c(10) : warning C4024: 'strcmp' : different types for formal and actual parameter 1
    c:\documents and settings\winson\desktop\data structure\forum.c(10) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'const char '
    c:\documents and settings\winson\desktop\data structure\forum.c(10) : warning C4024: 'strcmp' : different types for formal and actual parameter 2

    I would like to compare some of the character between two strings.

    I would like to know how i can solved this problem. For your information, i would like the solution in C and not C++. Thanks
    Last edited by winsonlee; March 7th, 2004 at 08:54 AM.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured