Default of malloc'd bool value within struct in C? -


what value of bool within struct when try access n->mybool? i'm interested know "default" value of bool after allocating memory not assigning true of false value.

#include <stdbool.h> typedef struct node {  bool mybool; } node;  void main() {  node* n = malloc(sizeof(node));  return; } 

edit: corrected typo in code (should sizeof(node) not sizeof(node)

there no default value. space allocated malloc uninitialized, , trying read n->mybool before writing value cause undefined behaviour.


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -