All pastes #804606 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-12-03 16:35 UTC
rendered paste body
#include <iostream>

using namespace std;

struct co {
       
  int x;
  int y;
  
};

int main() {

//maak een structer :D
co coclient;

coclient.x = 12;
coclient.y = 33;

co showme;

// pointer wich hold the adress of the structure?
char *pointer;

// this pointer is of a Structure co type
co *holddata;

// place the structure into a char
pointer = (char *)&coclient;

// put the char back to a POINTER structure
holddata = (co*)pointer;

// holddata holds the Adress ??
cout << holddata;

// how do i get it back to a structure and be able to call it like this
// cout << structname.x; 

    
cin.get();    
    
}