Skip to content

Instantly share code, notes, and snippets.

@toya33
Last active December 20, 2015 16:58
Show Gist options
  • Save toya33/6164897 to your computer and use it in GitHub Desktop.
Save toya33/6164897 to your computer and use it in GitHub Desktop.
vector<int>とvector<boolean>を要素数1で宣言した場合にそれぞれに必要なサイズを表示する
#include <StandardCplusplus.h>
#include <system_configuration.h>
#include <unwind-cxx.h>
#include <utility.h>
#include <vector>
void setup(){
Serial.begin(9600);
}
void loop(){
std::vector<boolean> vector_of_boolean(1);
std::vector<int> vector_of_int(1);
Serial.print("boolean size:");
Serial.println(sizeof(vector_of_boolean));
Serial.print("int size:");
Serial.println(sizeof(vector_of_int));
delay(1000);
}
@toya33
Copy link
Author

toya33 commented Aug 6, 2013

実行結果

boolean size:7
int size:7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment