diff options
author | Santo Cariotti <sancn@live.com> | 2017-04-25 17:17:24 +0200 |
---|---|---|
committer | Santo Cariotti <sancn@live.com> | 2017-04-25 17:17:24 +0200 |
commit | bca44eed99ddc009f6fc172f2654ba7ae6088598 (patch) | |
tree | 18edc25c21c5b7d30729be96104ecef235637657 /esempioLista.cc | |
parent | ed657ff62905f4b0b95e6b9c7f083596dcec416a (diff) |
Deleted old files
Diffstat (limited to 'esempioLista.cc')
-rw-r--r-- | esempioLista.cc | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/esempioLista.cc b/esempioLista.cc deleted file mode 100644 index b1e47c1..0000000 --- a/esempioLista.cc +++ /dev/null @@ -1,54 +0,0 @@ -#include <iostream> - -using namespace std; - -struct node -{ - int x; - node* link; -} node; - -struct node *crea(int N, struct node *p); - -int main() -{ - struct node *lista = NULL; - - lista = crea(3, lista); - - while(lista != NULL) - { - cout << "val -> " << lista->x << endl; - lista = lista->link; - } - return 0; -} - -struct node *crea(int N, struct node *p) -{ - struct node *punt; - p = new struct node; - - if(N == 1) { - cout << "Numero: "; - cin >> p->x; - - punt = p; - p->link = NULL; - } else if(N > 1){ - cout << "Numero: "; - cin >> p->x; - - punt = p; - for(int i = 2; i <= N; i++) - { - punt->link = new struct node; - punt = punt->link; - cout << "Numero: "; - cin >> punt->x; - } - punt->link = NULL; - } - - return p; -} |