Einzelnen Beitrag anzeigen

Elko

Registriert seit: 2. Feb 2008
52 Beiträge
 
Delphi 7 Personal
 
#8

Re: Arrays gezielt über Grenzen hinaus beschreiben

  Alt 2. Okt 2008, 21:19
Ahh, das ist schon mal ein guter Anfang:
Code:
unsigned char hallo[8],i,stelle=0,a=0;
for(i=0;i<8;i++)hallo[i]=0;
for(i=0;i<64;i++){
    *((long*)(&hallo[0])) |= (a<<stelle++);
    a=1;
}
printf("hallo= %x%x\n",hallo[1],hallo[0]);
So klappts Das Problem ist nur, dass ich nur beispielhaft lauter Einsen und eine Null reingeschoben habe und das mit den 10 Bits auch nur ein Test sein sollte. Insgesamt müssen es nämlich 64 Bit sein. Aber dafür gibt es ja m.E. keinen Datentyp...
Habt ihr noch eine Idee?

Gruß,
Elko
Keyboard not found. Press any key to continue.
  Mit Zitat antworten Zitat