Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //---------------------------------------------------------------------------
- #include <iostream.h>
- #include <vcl.h>
- #pragma hdrstop
- //---------------------------------------------------------------------------
- #pragma argsused
- struct something{
- float rando;
- something* next;
- };
- something *add(float in){
- something* b = new something;
- b->rando = in;
- b->next = NULL;
- return b;
- }
- int main(int argc, char* argv[]){
- something *a = new something;
- something *temp = new something;
- a->rando=500;
- a->next=NULL;
- temp=a;
- for (int i=1; i<5; i++){
- a -> next = add(500+i);
- a = a -> next;
- }
- a=temp;
- while(a->next != NULL){
- cout << a->rando << endl;
- a = a -> next;
- }
- system("pause");
- return 0;
- }
- //---------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement