1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
#include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
char kom[8][20] = {"$P1HUM = 39.22" ,"$P2HUM = 65.1",
"$P2TEMP = 26.19" ,"$P3HUM = 85.9",
"$P2HUM = 68.23" ,"$P1TEMP = 24.33",
"$P3TEMP = 29.5" ,"$P3TEMP = 28.74"};
for(int i=0;i<1;i++) //komunikaty
{
for(int j=0;j<16;j++)
{
if(kom[i][4]=='T') // !Here is my problem! asci T=84 H=72
{
printf("Point nr. %c, temperature measure, level %d%d.%d%d\n",kom[i][3],kom[i][11],kom[i][12],kom[i][14],kom[i][15]);
}
else if(kom[i][4]==72)
{
printf("Point nr. %c, wetness measure, level %d%d.%d%d\n",kom[i][3],kom[i][10],kom[i][11],kom[i][13],kom[i][14]);
}
else
{
//int a = 0;
printf("error reading \n");
}
}
}
return 0;}
|