URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 275 |
Rev 384 |
#include <stdio.h>
|
#include <stdio.h>
|
#include <stdlib.h>
|
#include <stdlib.h>
|
#include <string.h>
|
#include <string.h>
|
int main ()
|
int main ()
|
{
|
{
|
struct base {
|
struct base {
|
int basic;
|
int basic;
|
};
|
};
|
|
|
struct derived {
|
struct derived {
|
struct base common;
|
struct base common;
|
char extra;
|
char extra;
|
};
|
};
|
|
|
struct derived d;
|
struct derived d;
|
struct base *bp;
|
struct base *bp;
|
|
|
bp = (struct base *)&d;
|
bp = (struct base *)&d;
|
|
|
bp->basic = 10;
|
bp->basic = 10;
|
((struct derived *)bp)->extra = 'x';
|
((struct derived *)bp)->extra = 'x';
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.