Muhammed Yıldız Muhammed Yıldız - 1 year ago 135
C++ Question

How to read elements of array using c++?

I am taking datas from serial port using these commands Program screenshot, and this is my data ::02::03::98::00::07::20::16::09::29::16::19::45::C0::00::00::00

I can see coming datas using these commands;


but i don't use elements of buf[] array in any equations,for example i want to use buf[2] in a equation like below.


Can anybody help me ?

enter image description here

dd2 dd2
Answer Source

You might want to compare them in hexadecimal format.

if( buf[2]==0x02){
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download