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 -

java - Could not locate OpenAL library -

Non Unique Username with ASP.Net Identity 2.0 -