Skip to content

Instantly share code, notes, and snippets.

@kateolenya
Last active March 14, 2019 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kateolenya/6f81be3ee67bb7f884604267c91b8e01 to your computer and use it in GitHub Desktop.
Save kateolenya/6f81be3ee67bb7f884604267c91b8e01 to your computer and use it in GitHub Desktop.
Private variables in struct in C
#include "private_var.h"
#include <stdio.h>
int main()
{
struct Contact * Tony;
Tony = create_contact();
// printf( "Mobile number: %d\n", Tony->mobile_number);
// will cause compile time error
delete_contact( Tony );
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment