Pls help!Problem with CUDA Structure

Iam trying to modify my structure values in the kernel, but my result is junk value.
Cud pls anyone help? Pls anyone cud guide me to access the individual character elements inside the kernel?
This wud be of very great help!

#include <stdio.h>
#include <stdlib.h>
#include <cuda.h>
#include <string.h>
#include <math.h>
#include <cuda_runtime.h>

typedef struct align(16){
char a[8];
char b[8];
char c[8];
char d[8];
}myStruct;

int threads_per_block = 256;
int blocks_per_Grid = 6;

const dim3 ThreadBlockRows(threads_per_block,1,1);
const dim3 GridBlockRows(blocks_per_Grid, 1,1);

int sharedMemSize = threads_per_block * sizeof(char);

global void getsevbits(myStruct* oneport,myStruct* outport)
{
shared char* oneprtdta[256];

unsigned int tid = threadIdx.x;
unsigned int i = blockIdx.x*blockDim.x + threadIdx.x;

for(i = 1;i <= 8;++i)
{

// outport->a[i] = oneport->a[i];
// outport->b[i] = oneport->b[i];
// outport->c[i] = oneport->c[i];
// outport->d[i] = oneport->d[i];
outport->a[i]= 4;
outport->b[i]= 5;
outport->c[i]= 6;
outport->d[i]= 7;
}

 __syncthreads();

}

void checkCUDAError(const char *msg)
{
cudaError_t err = cudaGetLastError();
if( cudaSuccess != err)
{
fprintf(stderr, “Cuda error: %s: %s.\n”, msg, cudaGetErrorString( err) );
exit(EXIT_FAILURE);
}
}

int main(int argc, char **argv)
{
// int size = sizeof(myStruct);
int sharedMemSize = sizeof(char)*threads_per_block;
myStruct *d_data,*o_data,*h_data,*f_data;
int deviceCount,i,devid;
FILE *fp,*fd;
char file_name[1000]=“hhh.txt”;
char ofile_name[1000]=“opt.txt”;
h_data = (myStruct *) malloc(sizeof(myStruct));
f_data = (myStruct *) malloc(sizeof(myStruct));

cudaGetDevice(&devid);
cudaGetDeviceCount(&deviceCount); 
if (deviceCount == 0)
{
		fprintf(stderr, "there is no device, bad news...\n");
		exit(1); 
} 
else
{
		fprintf(stderr, "deviceCount: %d\n", deviceCount);
}
int dev;
for(dev = 0; dev < deviceCount; ++dev) 
{
	cudaDeviceProp deviceProp;
	cudaGetDeviceProperties(&deviceProp, dev);
	if(deviceProp.major >= 1)
  {
	fprintf(stderr, "device supports cuda, neat\n");
	break;
  } 
}
if (dev == deviceCount) 
{
	fprintf(stderr, "there is no cuda device, sorry...\n");
	exit(1);
}
else 
{
    fprintf(stderr, "cuda is good to go...\n");
    cudaSetDevice(dev); // make this device go
}

if (!(fp= fopen(file_name, "rb" ))) 
{ 
	printf("ERROR Opening FILE %s!\n",file_name); 
	exit(0); 
}
if (!(fd= fopen(ofile_name, "wb" ))) 
{ 
	printf("ERROR Opening FILE %s!\n",ofile_name); 
	exit(0); 
} 

if (cudaMalloc((void **)&d_data,sizeof(myStruct)) != cudaSuccess)
 { printf("Error allocating memory on device!\n"); exit(1); }
if (cudaMalloc((void **)&o_data,sizeof(myStruct)) != cudaSuccess)
 { printf("Error allocating memory on device!\n"); exit(1); }
 
fread(&h_data,256,1,fp);
cudaMemcpy(d_data,h_data,256,cudaMemcpyHostToDevice);

getsevbits<<<GridBlockRows,ThreadBlockRows,sharedMemSize>>>(d_data,o_data);	


cudaMemcpy(f_data,d_data,256,cudaMemcpyDeviceToHost);

fwrite(&f_data,256,1,fd);

fclose(fd);
fclose(fp);
cudaFree(d_data);
cudaFree(o_data);

// checkCUDAError(“kernel invocation”);
}

Iam trying to modify my structure values in the kernel, but my result is junk value.
Cud pls anyone help? Pls anyone cud guide me to access the individual character elements inside the kernel?
This wud be of very great help!

#include <stdio.h>
#include <stdlib.h>
#include <cuda.h>
#include <string.h>
#include <math.h>
#include <cuda_runtime.h>

typedef struct align(16){
char a[8];
char b[8];
char c[8];
char d[8];
}myStruct;

int threads_per_block = 256;
int blocks_per_Grid = 6;

const dim3 ThreadBlockRows(threads_per_block,1,1);
const dim3 GridBlockRows(blocks_per_Grid, 1,1);

int sharedMemSize = threads_per_block * sizeof(char);

global void getsevbits(myStruct* oneport,myStruct* outport)
{
shared char* oneprtdta[256];

unsigned int tid = threadIdx.x;
unsigned int i = blockIdx.x*blockDim.x + threadIdx.x;

for(i = 1;i <= 8;++i)
{

// outport->a[i] = oneport->a[i];
// outport->b[i] = oneport->b[i];
// outport->c[i] = oneport->c[i];
// outport->d[i] = oneport->d[i];
outport->a[i]= 4;
outport->b[i]= 5;
outport->c[i]= 6;
outport->d[i]= 7;
}

 __syncthreads();

}

void checkCUDAError(const char *msg)
{
cudaError_t err = cudaGetLastError();
if( cudaSuccess != err)
{
fprintf(stderr, “Cuda error: %s: %s.\n”, msg, cudaGetErrorString( err) );
exit(EXIT_FAILURE);
}
}

int main(int argc, char **argv)
{
// int size = sizeof(myStruct);
int sharedMemSize = sizeof(char)*threads_per_block;
myStruct *d_data,*o_data,*h_data,*f_data;
int deviceCount,i,devid;
FILE *fp,*fd;
char file_name[1000]=“hhh.txt”;
char ofile_name[1000]=“opt.txt”;
h_data = (myStruct *) malloc(sizeof(myStruct));
f_data = (myStruct *) malloc(sizeof(myStruct));

cudaGetDevice(&devid);
cudaGetDeviceCount(&deviceCount); 
if (deviceCount == 0)
{
		fprintf(stderr, "there is no device, bad news...\n");
		exit(1); 
} 
else
{
		fprintf(stderr, "deviceCount: %d\n", deviceCount);
}
int dev;
for(dev = 0; dev < deviceCount; ++dev) 
{
	cudaDeviceProp deviceProp;
	cudaGetDeviceProperties(&deviceProp, dev);
	if(deviceProp.major >= 1)
  {
	fprintf(stderr, "device supports cuda, neat\n");
	break;
  } 
}
if (dev == deviceCount) 
{
	fprintf(stderr, "there is no cuda device, sorry...\n");
	exit(1);
}
else 
{
    fprintf(stderr, "cuda is good to go...\n");
    cudaSetDevice(dev); // make this device go
}

if (!(fp= fopen(file_name, "rb" ))) 
{ 
	printf("ERROR Opening FILE %s!\n",file_name); 
	exit(0); 
}
if (!(fd= fopen(ofile_name, "wb" ))) 
{ 
	printf("ERROR Opening FILE %s!\n",ofile_name); 
	exit(0); 
} 

if (cudaMalloc((void **)&d_data,sizeof(myStruct)) != cudaSuccess)
 { printf("Error allocating memory on device!\n"); exit(1); }
if (cudaMalloc((void **)&o_data,sizeof(myStruct)) != cudaSuccess)
 { printf("Error allocating memory on device!\n"); exit(1); }
 
fread(&h_data,256,1,fp);
cudaMemcpy(d_data,h_data,256,cudaMemcpyHostToDevice);

getsevbits<<<GridBlockRows,ThreadBlockRows,sharedMemSize>>>(d_data,o_data);	


cudaMemcpy(f_data,d_data,256,cudaMemcpyDeviceToHost);

fwrite(&f_data,256,1,fd);

fclose(fd);
fclose(fp);
cudaFree(d_data);
cudaFree(o_data);

// checkCUDAError(“kernel invocation”);
}