convert one letter string to a char

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Erjan
    New Member
    • Jun 2011
    • 4

    convert one letter string to a char

    i m having trouble with converting a string to a char

    Code:
    function(char thing, int x , int y){
    ..................
    }
    
    int main(){
       string input ;
       function(input, 2,3) ;// does not work because it needs 
                             //the first arg to be char    
    }

    just a sample of what i m doing:

    the real stuff i use:

    function("I",2, 3) ;

    must be like

    function("I",2, 3) ; and so on
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    You can access character the way you access array. Follow the link :
    operator[]/

    Comment

    Working...