Skip to content

Instantly share code, notes, and snippets.

@y-fedorov
Created January 25, 2016 10:03
Show Gist options
  • Save y-fedorov/95f67dca95461060aea1 to your computer and use it in GitHub Desktop.
Save y-fedorov/95f67dca95461060aea1 to your computer and use it in GitHub Desktop.
Test example - size of structure.
//
// main.cpp
//
// Created by Yaroslav Fedorov on 12/01/16.
// Copyright © 2016 Yaroslav Fedorov. All rights reserved.
//
#include <iostream>
struct A {
char p_1;
double p_2;
short p_3;
short p_4;
};
int main(int argc, const char * argv[])
{
std::cout << sizeof(A) << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment