Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- struct item{
- int itemid;
- float price;
- };
- int main()
- {
- struct item *temp;
- temp=(struct item*)malloc(2*sizeof(struct item)); // 2 memory allocate er jonno size
- temp->itemid=101; //1 no tate value assign
- temp->price=24.5; //1 no tate value assign
- (temp+1)->itemid=103; //memory address +1 kore porer memory address e 2 no value assign
- (temp+1)->price=35.8; //memory address +1 kore porer memory address e 2 no value assign
- for(int i=0;i<2;i++)
- {
- printf("%d %f\n",(temp+i)->itemid,(temp+i)->price);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement