TypeCasting Programming Software Development by pbracing33b … sure as to well. I have to have this in TypeCasting I would love to run all doubles but I'm… Re: TypeCasting Programming Software Development by Ancient Dragon line 70 is attempting to store a value that is less than zero into an integer, which can not hold such values. If you are not allowed to use doubles than multiply the result of the division by 100 and assign that to the integer. Example: (1/2) \* 100 = 0.5 \* 100 = 50, meaning 50%. Re: C typecasting offset Programming Software Development by Trentacle [QUOTE=3435;1725525][B]Hello everyone!![/B] I am new to Linux forum and have a question related to typecasting in C related to offset of structures. <snip>[/QUOTE] Typecasting is something that happens to actors... Void Pointer to userdefined Object - Typecasting Programming Software Development by Skeen … be possible, and really is there any good guides on typecasting? Thanks in advance! C typecasting offset Programming Software Development by 3435 … new to Linux forum and have a question related to typecasting in C related to offset of structures.I have a… Typecasting Programming Software Development by shazzy99 Is there any way to type casting from NumberUpDown to string? Typecasting Programming Software Development by shazzy99 Is there any way to type casting from NumberUpDown to string? Couldn't get much help from msdn :( Re: Typecasting Programming Software Development by ddanbe What is NumberUpDown ? Re: Typecasting Programming Software Development by ddanbe OK I have it.(Have had a coffee now...) You can have a string out of a Numeric Up Down control with: MyNumUpDown.Value.ToString(); Re: Typecasting Programming Software Development by vuyiswamb what is your Question Exactly, try to be in details Re: Typecasting Programming Software Development by LizR You mean like the one that comes with it, eg [code]numericUpDown1.Value.ToString();[/code] I guess you didnt look very far Re: Typecasting Programming Software Development by ddanbe Strange I answered this same thread 7 days ago also?? Re: Typecasting Programming Software Development by LizR people love to wake old threads, especially when people dont bother to mark them as solved. Re: Typecasting Programming Software Development by ddanbe I said same thread, but meant similar... Re: Typecasting Programming Software Development by LizR I seem to remember this was a dup. Re: Typecasting Programming Software Development by ddanbe Quite right and so we can go on and on and on... Re: Typecasting Programming Software Development by rapture We need a way to "force solved" any thread that is either open for too long or solved but the poster won't mark it . . . Re: Typecasting Programming Software Development by LizR IMHO any thread left for more than 3 weeks untouched, should auto close. As either the OP has lost interest, or found another way. Re: Typecasting Programming Software Development by ddanbe Yeah, you are right rapture, but what is solved? Some problems are easily solved, others are quite complex and "unsolvable" in a few do this and do thats. Some users read the solution you give to their problem and leave for the planet Mars(whatever) never to come back again. How do you gonna tackle all those? I am almost certain the &… typecasting Programming Software Development by tubby123 Why is it that this won't work instead of using atoi ? `Inline Code Example Here` #include<stdio.h> int main(void) { printf("%d",(int)"10"); return 0; } Re: typecasting Programming Software Development by deceptikon Casting in C says 'treat me like something else at the byte level'. `"10"` is not the same thing as `10` at the byte level, so the cast doesn't do what you want. Re: typecasting Programming Software Development by Ancient Dragon If you want to convert "10" to 10 then you need to call one of the conversion functions, such as atoi() ~~~ printf("%d\n", atoi("10")); ~~~ Typecasting on littleendian and bigendian Programming Software Development by kux hello, I have the following problem I have an unsigned long variable, but it is designed to hold values within 0 .. 100 ( I know an unsigned char would have been enough, but i have to use an unsigned long ). I have to write that value in a file on a single byte. if i do fwrite(&unsignedlongvar, 1, 1, file ) it will write the octet on … Re: Typecasting on littleendian and bigendian Programming Software Development by tesuji what about solving little/big endian problem by doing appropriate typecast before writing to file? Re: Typecasting on littleendian and bigendian Programming Software Development by vijayan121 > Is there any standard function to test the endianess of the system? [code=c++]inline bool little_endian() { union { long i ; char c[ sizeof(long) ] ; }; i = 1 ; return c[0] == 1 ; }[/code] Re: Typecasting on littleendian and bigendian Programming Software Development by Salem > what about solving little/big endian problem by doing appropriate typecast before writing to file? Because endian can't be fixed with a simple cast. You have to write code to rearrange the bytes into the correct order. > Is there any standard function to test the endianess of the system? Not only is this non-portable (it assumes far … Re: Typecasting on littleendian and bigendian Programming Software Development by Duoas If you know your target value will fit in a smaller integer, you really don't need to worry about endianness. Do as [b]tesuji[/b] suggests and let the compiler do the appropriate movement: [code=C++] fputc( unsignedlongvar, file ); // bits 8..31 are lost! [/code] Don't use [b]fwrite[/b]() for size-specific I/O. The C and C++ standards … Re: Typecasting on littleendian and bigendian Programming Software Development by tesuji Hi Salem, [QUOTE=Salem;606802]> what about solving little/big endian problem by doing appropriate typecast before writing to file? Because endian can't be fixed with a simple cast. You have to write code to rearrange the bytes into the correct order. > Is there any standard function to test the endianess of the system? Not only is … Re: Typecasting on littleendian and bigendian Programming Software Development by Salem > Is there any standard function to test the endianess of the system? This was an original question - what are you smoking? Typecasting enumerated type Programming Software Development by VernonDozier Hopefully this is fairly basic. I've never used enumerated types in Java. I'm sort of trying to take my C concept of them and make it work in Java. Basically use them as constant integer values. That might be putting the square C block into the round Java hole. I'm not sure. Here's the code. It's giving me errors in lines 42 and 47 (…