Hello. I have some questions.... I think that is not something important but if someone knows we can discuss it.
The questions are :
1) I have a signed type of char in my system.... Since the underlying sets of characters may vary from one system to another.... what is the values between -127... 0 ? I tried to print some of them -> printf("%c" , -127 ); but it doesn't work (I didn't get a meaningful output... I get a black '?' for example.
2) A book says that we can perform arithmetic on boolean variables... but it doesn't give an example ( it is also not advisable to perform arithmetic on boolean variables as it writes...) . this -> printf(" %d " , false + 2 ) is an arithmetic operation with booleans ???
3)I take infinite loop here and I can't understand why.... If I modify a[3] to a[4] and i<5 inside for I take no infinite loop :S I am confused. I believe that I have understand how for works....Code:#include<stdio.h> int main(void) { int i , a[3] = {0}; for(i = 0; i < 4 ; a[i++] = 2 ) printf(" %d ", i ); for(i = 0; i<3; i++) printf(" %d ", a[i]); return 0; }
and the last one :P
4)
If I have an array with n elements
like int a[n] (Variable length array) and a function
int sum_array( int a[static 4] , int n)
I think that It doesn't make any sense if I give 2 elements in my array.
I have read that a presence of static is merely a hint that may allow a C compiler to generate faster instructions for accessing the array.
Thank you in advance.....



LinkBack URL
About LinkBacks




