I am fairly new to C and during one of my exercises I encountered something I couldn't wrap my head around. When I check the size of an element of tabel (which here is 'b') than I get 4. However if I were to check 'char' than I get 1. How come?
# include <stdio.h>
int main(){
char tabel[10] = {'b','f','r','o','a','u','v','t','o'};
int size_tabel = (sizeof(tabel));
int size_char = (sizeof('b'));
/*edit the above line to sizeof(char) to get 1 instead of 4*/
int length_tabel = size_tabel/size_char;
printf("size_tabel = %i, size_char = %i, lengte_tabel= %i",size_tabel,
size_char,length_tabel);
}