I am bit new to C language and I have a question in some basic principles about C. I'm on the way of implementing a custom complex library that deals with fixed point arithmetic.
We can use a library called complex.h in C. using that library we can declare and initialize complex variable as below.
complex float a = 2 + 3I;
complex float b = 5 + 2I;
complex float c = a + b;
but when we adding this two complex float, how does the compiler understand that we are going to add two complex numbers. Does the compiler understand it using its data type?
Then what is the approach that we need to follow implement a data type like complex?
I already know how to implement that using structures. But I need to know about how I make that structure to deal with a variable given in the format of a + bI
.
To be more clear my question is how I deal with that 'I' character inside my Structure?