Can anyone help me convert char to double. Yes, I tried casting, it did not work. Anyway, this is the problem, the variable is declared as type double in the struct(database structure). However, it is defined as type Text in the class I'm modifying.

The variable in the class I'm using must remain that type because it is used by other functions in the class. Please help

Nis

Type Text is probably a string of some sort, rather than type char per se'. This then becomes similar to converting type int to a string, whcih may be in a FAQ somewhere. In any event, I'd try using a stringstream (C++ style) or sprintf() (C style) to convert the double to a string and then convert the string to type Text, if necessary.

Thanks for the advice and I will not bash casting (cause it does and excellent job) but for this program its not the solution. It solves the run time warnings but logically, it does not generate the likely response.

Do you have any more ides.

Thanks for the advice and I will not bash casting (cause it does and excellent job) but for this program its not the solution. It solves the run time warnings but logically, it does not generate the likely response.

You cannot cast a string to an integer or floating point value or vice versa.

Do you have any more ides.

Uh, yeah. Follow the link I posted.

Thanks for the advice and I will not bash casting (cause it does and excellent job)

List your top 5 things that cast does an excellent job at. I'd speculate that 3-4 of them are used incorrect. (Of course I'd be happy to be wrong.)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.