H3llT0uCh Posted May 21, 2009 at 03:38 PM Report #266182 Posted May 21, 2009 at 03:38 PM Boas, alguem me pode dizer como resolvo estes warnings? warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result cumps.
Triton Posted May 21, 2009 at 04:03 PM Report #266190 Posted May 21, 2009 at 04:03 PM Verificas o valor de retorno do fgets. <3 life
H3llT0uCh Posted May 21, 2009 at 04:06 PM Author Report #266192 Posted May 21, 2009 at 04:06 PM Como assim? o código está assim por exemplo: fgets(line,100,fh)
nata79 Posted May 21, 2009 at 04:41 PM Report #266207 Posted May 21, 2009 at 04:41 PM o fgets retorna o valor lido e NULL se falhar. o que deves fazer é, por exemplo: (claro que depende muito do contexto) if(fgets(line,100,fh) == NULL){ //se o fgets não conseguir ler nada //código para tratar o erro } arithmeticoverflow.wordpress.com
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now