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

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -