Osintgram icon indicating copy to clipboard operation
Osintgram copied to clipboard

What should I do here , what's wrong in this code ?

Open mohamoed opened this issue 2 years ago • 0 comments

`

             #include<iostream>
             #include<string>
             void leng(std::string letter)
               { 
           for (int i = 0; i < letter.length(); i++)
           {   
	 
	      char letter_string = letter.at(i);
	      printf("\n\n the letter %d is = %s ",i ,letter_string);

            }

                }

       void main ()
    {
        std::string HAND;
        printf("Enter anything in your mind : "); std::cin >> HAND;
        printf("\n\n WHAT written is : %s ", HAND);
        leng(HAND);
    } 

`

this code aims to print every word or letter in any string I write , every time I run this code it outputs like :

`

    Enter anything in your mind : HELLO


    WHAT written is : └¶lóz☻


    and exception thrown at 0x00007FFEA1862487 (ucrtbased.dll) in program .

`

what should I do .

mohamoed avatar Sep 13 '22 19:09 mohamoed