How to show arduino receiving data using C code to PC termianl

Hello all,
I have two programs and I am using two arduino. One is receiver end and other one is sender. Its working fine. I can see the result with com port and also using XCTU.

Now I am trying to read the data that process by receiving end[arduino] using C code. Can anybody please tell me how can I do that. Or help me with a sample code.

Reading Serial data on an Arduino from another Arduino is no different from reading Serial data from the Serial Monitor or other terminal programs (Assuming you are using the UART, versus SoftwareSerial), so any of the Serial communications examples would apply.

I am trying to use the below code read data but not working...
Is there any other way to do that.

#include <stdio.h>

#include <windows.h>

#include <fcntl.h>

#include <io.h>

int fd = 0;
char psResponse[20];
double n;
int bytes;
char buffer[2000];

int main(void) {
fd = open("COM8", O_RDWR );
while(1)
{
// write(fd, "o", 1);
// read(fd, psResponse, 2);
// n = atoi(psResponse)*0.322265625;
// printf("%.1f\n", n);

bytes = read(fd, &buffer, sizeof(buffer));
// printf("number of bytes read is %d\n", bytes);
printf("%s\n", buffer);
Sleep(5000);
}
close(fd);
}

Read this before posting a programming question

Code tags please.

The question seems to be about how to write a PC application to receive data from the Arduino's serial port, and you could update the thread title to reflect that.

There are a few examples in the Arduino playground showing how to do this in various languages, including C++.

There is also a section of the forum dedicated to interfacing the Arduino with software running on your computer, and if you still have trouble after reviewing the code in the playground I suggest that would be the best place to ask for help.