← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Given a list of C++ struct member declarations (each as a string containing type and name), return the exact byte size the struct will occupy under LP64 data-model rules (char 1/1, short 2/2, int 4/4, long 8/8, float 4/4, double 8/8, pointer 8/8, bool 1/1). Members must appear in the order supplied. The compiler inserts padding so every member starts at an offset that is a multiple of its alignment requirement, and the total struct size is rounded up to a multiple of the largest member alignment. Implement the function size_t structSize(const vector<string>& members);