Results 1 to 1 of 1
Thread: Types and typecasting in C
08-17-2009, 03:01 AM #1
- Join Date
- Aug 2009
Types and typecasting in C
I have some generic questions on types and typecasting.
1. When will implicit type conversion (coersion) occur?
2. Can you create your own typecasting "functions"?
3. The malloc functions (malloc, calloc...) returns a void pointer, most programmers use explicit type conversion to get it to the wanted type. I tested excluding this type conversion and I didn't get any errors, is type conversion necessary in this case?
1. Except for structures and unions, does a type contain more information than the size and how to use arithmetic and bitwise operations?
2. Is there any reason to use the const keyword?
3. Can you define arithmetic operations (/*-+) between your own types?
Pretty basic questions but I couldn't find much information in C programming language. Thank you for your answeres.