Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6901787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:43:02+00:00 2026-05-27T07:43:02+00:00

A link list that can hold float,integer,character,etc data and algorithm should be well and

  • 0

A link list that can hold float,integer,character,etc data and algorithm should be well and not very complex

I thought of creating a structure with void pointer that will point to subsequent nodes. but problem is that i cannot use templates with structure.

coming down to c, i have to test each character entered by user to test whether it is integer , float or character or not.then we can proceed further

please suggest an efficient algorithm/code

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:43:03+00:00Added an answer on May 27, 2026 at 7:43 am

    If you want to do this yourself you’ll basically want to create an array or linked list of elements that encode both the data and the type of data. You could use a struct that includes a type indicator and a union of the various types that you want to handle, and the create an array or linked list of that struct:

    typedef struct {
        int type_indicator;
        union {
            float f;
            int i;
            double d;
            void *p;
            char c;
        }
    } generic_item;
    
    generic_item generic_array[10];
    

    I’ll leave it to you to come up with an appropriate enumeration for the type indicator and to add a function pointer for your algorithm. If you want a linked list instead of an array, you’ll obviously also need to add a generic_item *next pointer.

    I haven’t looked into the boost options that other answers link to, but I’d probably look there first before trying to roll my own solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone link to or list out the object types that the iphone sdk
I have a double link list that stores some information. When I try and
I have grid that has a list of about 16 documents that can change
I'm trying to implement a link list which stores the city name (though you
another issue in IE 6... link The navbar link list has a border applied
I'm having this link statement: List<UserGroup> domains = UserRepository.Instance.UserIsAdminOf(currentUser.User_ID); query = (from doc in
Is there some way to replicate rails' link-to-unless-current? Ie. if i have a list
I have tried to do this refering to following link. http://skypher.com/index.php/2008/07/28/function-list-for-php/ But no success.
Link: http://www.fraynepainting.com/services The problem is that div#dditem_2 (the div with the Take a look...
http://clifgriffin.com/blockade2/ Ok, I have an unordered list that serves as a list of menu

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.