c - Compare multi-dynamic structure of pointers in memory? -


basically, want achieve follows;

i want able compare pointer-pointer structure block in memory without having iterate through of values dynamically. working api-hook, crucial use little "for loop iteration" possible, better-yet, use none.

basically, assume have structure

typedef struct mystruct {   ushort age;   pchar username; } _mystruct, *__mystruct; 

then initialize so

__mystruct *pointer; zeromemory(&pointer, null); 

now assume structure filled group of values in each variable. let's have defined number 'x', , given 'y' given index in pointer structure.

for (int y = 0; y < sizeofstructure; ++y)   if (x == pointer[y]->age)     // do_something(); 

so, in case, 'y' iteration variable for-loop, how can along line of:

if (memcmp(&pointer, x) == 0)   // do_something(); 

so in case not iterating structure, , instead comparing of elements in memory @ once? for-loop operation with-in critical_section either way still lead crash of process. there way can in safe manner described above?


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -