hi
working on a project, and VS2005 is giving me this warning:
- warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
the warning leads here:
can anyone tell me how to "fix" this warning?Code:tam = strlen(texto[n]);
hi
working on a project, and VS2005 is giving me this warning:
- warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
the warning leads here:
can anyone tell me how to "fix" this warning?Code:tam = strlen(texto[n]);
Last edited by IndioDoido; 05-09-2007 at 09:02 PM.
"Artificial Intelligence usually beats natural stupidity."
Use size_t as your variable type instead of int.
Code:size_t len; ... len = strlen("bleh");
hey MacGyver!
i did what you said, but now it's giving me this warning:
- warning C4018: '<' : signed/unsigned mismatch
and now the warning leads here:
??Code:for(l=0; l<(71-tam); l++)
"Artificial Intelligence usually beats natural stupidity."
I bet you haven't set l as a size_t as well.
If l is already an unsigned type, then it might be worrying about 71-tam possibly being negative. You can always rewrite the condition like this:
Code:for (l=0; 1+tam<71; l++)
High elevation is the best elevation. The higher, the better the view!
My computer: XP Pro SP3, 3.4 GHz i7-2600K CPU (OC'd to 4 GHz), 4 GB DDR3 RAM, X-Fi Platinum sound, GeForce 460, 1920x1440 resolution, 1250 GB HDD space, Visual C++ 2008 Express
I think this is why you should never use lower case 'L' as a variable name if you can help it.
I agree, use an uppercase 'i' instead
hey you all!
i havent set 'l' as site_t, i'm going to try that, and if doesn't work i'm going to apply one these versions
Code:for (l=0; 1+tam<71; l++)Code:for (l=0; tam<=71; l++)
"Artificial Intelligence usually beats natural stupidity."
The second version is wrong (I guess you didn't get the joke).
ehehe!
I know it was :P
i've seted the variables to size_t and it worked...tnx alot guys!
buy the way, what does this warning mean?
- warning C4013: 'menuLogin' undefined; assuming extern returning int
every time i reference a function that warning apears
"Artificial Intelligence usually beats natural stupidity."
hi brewbuck!
i've done what you said, and it worked with the menuLogin function. But with the other functions it didn't
know i gives me these warnings:
- warning C4024: 'titulos' : different types for formal and actual parameter 1
- warning C4047: 'function' : 'char **' differs in levels of indirection from 'char *(*__w64 )[1]'
"Artificial Intelligence usually beats natural stupidity."
I don't know if I'm the only one growing tired of playing 20 questions here.
If you had stripped the base code down into a minimal compilable snippet you'd have had an answer days ago. It might be worth 20 minutes to try to do so now.
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
geatings dave!
nevermind the last question brewbuck, i've resolved it
thanks anyway for the help.
saluts
"Artificial Intelligence usually beats natural stupidity."