English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

8 answers

That's a pretty ambiguous question.

Usually I get invalid data type CONVERSION errors when I try to convert from like a Float to an Int or vise versa.

You probably need to static_cast it.

int I;
float h = 9.0;

I=static_casth;

2007-04-04 06:11:54 · answer #1 · answered by Anonymous · 1 0

Well, if you know what data types are, then you should understand the problem.
Data types relate to the size of the data and/or where the data is used.
For example, if you passed a byte variable to a function that expects an integer value, then you'll get an error from the compiler.
Windows takes data types to an idiotic level. For example, Windows has data types such as HANDLEs. Now, say that I copied the value for a handle into a variable that was declared as an unsigned integer, then passed that variable to a Windows function which expects a HANDLE. I'd wind up with an error from the compiler.
This, despite the fact that HANDLEs and unsigned integers are the same size (dword).
In fact, data type checking on the whole is just plain stupid. Thank God I can avoid all that nonsense with Assembly language.

To fix your problem, read the reference information about what parameters are required for the function that you are calling, then either use casting or use the proper data type.

2007-04-04 13:20:16 · answer #2 · answered by Balk 6 · 0 0

Are you DOING the programming or entering data?

If you put TEXT into a field that is restricted to using numbers, that is invalid data. So is typing a date like 02043012 if the field is restricted to month/day/year between 1900 & 2100, for example. So it depends on the field and the information being put in -- there is some kind of mismatch.

2007-04-04 13:12:11 · answer #3 · answered by Yahzmin ♥♥ 4ever 7 · 0 0

You're probably dealing with a conversion problem. A variable has a datatype associated with it, that is a kind of data which it can hold.

You're probably trying to store a type of data that is not compatible with your the data type of the variable. Your compiler is generating an "invalid data type" error.

Hope this helps.

2007-04-04 14:10:59 · answer #4 · answered by Smutty 6 · 0 0

Hi Trudy,
You are trying to perform an operation on a kind of data for which that operation is not defined. For example, you might be trying to add a string to an integer or do a string search on a floating point number. If you look at the line of code where the error appears, you should be able to identify which data item is causing the problem. Is the line of code is complex, I suggest that you break it up into multiple lines of code and then observe where the error appears.

2007-04-04 13:15:17 · answer #5 · answered by nicomp 4 · 1 0

This is mostly when you are trying to add text/string data in to numeric field. Some common things to look for is dates when you enter April instead of "04".

You have to find which variable is having problem and get debug statement displaying both values before and new value. It will be much easier to spot when you take a look at both values.

2007-04-04 13:13:05 · answer #6 · answered by askMahesh 3 · 0 0

There's not enough information here to help you with this. What application are you using? When do you see this message?

The basic is that whatever you're doing is producing a result with a different type then what is expected. Post more detail about the issue for better help.

2007-04-04 13:11:44 · answer #7 · answered by Snoopy 5 · 1 0

change the data type.

2007-04-04 13:11:02 · answer #8 · answered by tonberry79 3 · 0 0

fedest.com, questions and answers