Jump to content

Problema com string


TDIIII
 Share

Recommended Posts

char i[50];
char v[]="read";

printf("insira uma palavra");

fgets(i,50,stdin);

if(i==v)
........

o que eu pretendia é que o if detecta-se quando o utilizador digite a mesma string que v mas assim como tenho no codigo nao detecta

ou seja

se eu digitar no teclado read a variavel i armazenar a string "read" e executar o if caso o que esteja no i ser igual ao que esta no v

alguem me pode ajudar?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.