Osintgram
Osintgram copied to clipboard
What should I do here , what's wrong in this code ?
`
#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 .