473,383 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Stacks

6
Is it possible to creat a linked list of structs?
If so how would this be done?

Advanced thanks
Matt
Jun 3 '07 #1
2 1011
Savage
1,764 Expert 1GB
Is it possible to creat a linked list of structs?
If so how would this be done?

Advanced thanks
Matt
Yes it is possible.

U will need to first creare a struct and then another struct that will have previos struct and a pointer to a next element.

e.g

Telephone book:

First struct:

Expand|Select|Wrap|Line Numbers
  1. typedef struct data{
  2.  
  3.              string first name,lastname,city,telephone1,telephone2...
  4.  
  5. }TUser;
Secound struct:

Expand|Select|Wrap|Line Numbers
  1. typedef struct node{
  2.  
  3.                         TUser info;
  4.                         struct node *next;
  5. }TNode
Savage
Jun 3 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
Locate the book "Teach Yourself Data Structures in 24 Hours".

Failing that, locate "Algorithms in C++" by Robert Sedgewick.

Failing that, locate "The Art of Computer Programming" by Donald Knuth.
Jun 3 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Vanessa T. | last post by:
Hello All! Is there a place where I can learn stacks, (push and pop) etc. Thanks,
4
by: Ice | last post by:
Hi there, I'm not sure if this is the right group for this- If it isn't, could anyone point me in the right direction? For our data structures exam, we are usually asked to implement the...
6
by: Sathyaish | last post by:
I've searched Google and found a few, but I am not so satisfied. Any good reading on "stacks and heaps" about how and when memory is allocated from the heap?
18
by: pmm | last post by:
Hi all, Plz dont fire at me if this is a silly question Is there any way to know in which direction stack grows pmm
1
by: LedZep | last post by:
This program has to use a stack to determine whether a string is a palindrome (a string that is spelled identically backward and forward). The program has to ignore spaces, case sensitivity and...
10
by: Rich Kucera | last post by:
Holding all versions at 5.0.4, Multiple stacks with multiple-version configurations inevitable Will have to wait to see what the impact of problems such as http://bugs.php.net/bug.php?id=33643 ...
2
by: Daniel | last post by:
Hi, I have a question regarding the memory managment in stl stacks. I want to use stacks to store a very large amount of numbers (some millions), thus I'm interested in how the stack behaves...
2
by: chubbykelly | last post by:
hi, i got a prob with the new topic my teacher in data struct taught us this afternoon. he introduced the concept of stacks. simulated how 5 elements will be pushed and popped out to the array...
0
by: raghuveer | last post by:
i want to implement multiple stacks using arrays..I am able to create ,insert and print them but not poping an element form any of the stack..This is what i have #include<stdio.h>...
8
by: cerise | last post by:
I can't figure out how to make and handle multiple stacks and use them so I could create four linked list stacks representing each suit of cards, one stack each for diamonds, hearts, spades, and...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.