how would i go on about adding an item into an array. the catch here, is that instead of adding content normally, i want the added content to be added as a linked list. for example, if i add something into the first slot, and want to add another item similar to the first in the same slot, i would do so implementing a linked list function. i have a linked list header file which will do the adding, but i dont know how to make it work for an array.
any help would be greatly appreciated.
hsquared
0
Newbie Poster
Recommended Answers
Jump to PostIF you want data added as a linked list why not just use a linked list ?
try googling linked lists in C++ for example
http://www.dreamincode.net/code/snippet82.htm - just gives you an example of how …
Jump to PostYour intent is a little confusing, it sounds like you want to add multiple items to the same element of an array. Which is not directly possible.
You mentioned using a linked list to do this. This would work, but you would need an array of lists. Each element …
Jump to PostYour intent is a little confusing, it sounds like you want to add multiple items to the same element of an array. Which is not directly possible.
Actually, I think if you create a structure, and then create an array of that structure, you can do what the op is …
Jump to PostYes, you can make an array of any defined data type, whether built-in or user-defined. But you can't create, for example, and array of integers and store more than one integer in an element, if you attempt to do so, you'll simply overwrite the element with the new integer value. …
All 13 Replies
elsiekins
0
Junior Poster
Fbody
682
Posting Maven
Featured Poster
kes166
37
Practically a Master Poster
Fbody
682
Posting Maven
Featured Poster
kes166
37
Practically a Master Poster
hsquared
0
Newbie Poster
hsquared
0
Newbie Poster
Fbody
682
Posting Maven
Featured Poster
Fbody
682
Posting Maven
Featured Poster
hsquared
0
Newbie Poster
Lerner
582
Nearly a Posting Maven
kes166
37
Practically a Master Poster
Fbody
682
Posting Maven
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.