A little problem with initalize the memory

Hi @all

// Complex data type

typedef float2 Complex;

void runTest(int argc, char** argv)


if( cutCheckCmdLineFlag(argc, (const char**)argv, “device”) )

    cutilDeviceInit(argc, argv);


    cudaSetDevice( cutGetMaxGflopsDeviceId() );

// Allocate host memory for the signal

Complex* h_signal_a = (Complex*)malloc(sizeof(Complex) * SIGNAL_SIZE);

// Initalize the memory for the signal

for(unsigned int i = 0; i < SIGNAL_SIZE; ++i) 


    h_signal_a[i].x = i;

    h_signal_a[i].y = 0;

//printf(“Wert: %d \n”,i);

    printf("Wert: %d \n", h_signal_a[i].x);      //  -->  <b>Here is my problem</b>

    printf("Wert: %d \n", *h_signal_a[i].x);    //  -->  <b>Here is my problem</b>



My problem is to show my initalize value on the console. What is the misstake?

You are printing using %d. Try %f.