Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Thread

#include <stdio.h>

#define SIZE_OF_DATA_FROM_DEVICE_DRIVER 10
int datafromDD[], datatobuffer[];
int i = 0;

int readfromDDandwriteTobuffer()
{
    readDatafromDD(datafromDD);
    int j = i-SIZE_OF_DATA_FROM_DEVICE_DRIVER;
    
    
    for( ; j < i ; j++ )
    {
        datatobuffer[j] = datafromDD[j];
        printf("%d ",datatobuffer[j]);
    }
    
    printf("\n");
    
}

void readDatafromDD(int * data)
{
    int limit = i+SIZE_OF_DATA_FROM_DEVICE_DRIVER;
    for( ; i < limit ; i++ )
    {
        data[i] = i;
        //printf("%d",datafromDD[i]);
    }
}

int main(void) {
	printf("hi");
	int x = 0;
	while( x < 10)
	{
	readfromDDandwriteTobuffer();
	    x++;
	}
	return 0;
}


Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.