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

  • SEARCH
  • Home
  • 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 6922339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:23:36+00:00 2026-05-27T10:23:36+00:00

I have to organize a struct or an array of some people’s first name,

  • 0

I have to organize a struct or an array of some people’s first name, last name, and age then organize them in alphabetical order writing them from an input file to an output file using the string library.

This is partically for a Lab that I have tomorrow afternoon in which my TA said we might be asked to complete the task I stated above. I’m trying to get opinions or suggestions from individuals whom are much more experienced in C than myself so I’ll be more prepared than I was last lab where I didn’t so hot.

I’m stuck, any suggestions on where I should start?

  • 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-27T10:23:37+00:00Added an answer on May 27, 2026 at 10:23 am

    Well, reading and writing the input and output should be a no brainer (you open the file, read/write and then close it when you’re done with it).

    The trick is to get those pesky strings sorted.
    The way I look at strnig sorting is an array of arrays sorting. The first array-level is an iteration over all the structs while the second is an iteration over all the letters of a name (note that some names are longer then others)
    1. First you sort the first column – all the first letters
    2. Then all the sub-columns – within each first letter group you sort the second letter
    3. Repeat 1&2 until you run out of letters to sort.

    The sorting of an array of letters is the same as sorting an array of byte (AKA chars), and if you’re working with an algorithm like bubble sort, working on a sub array is seamless.

    Hope this idea helps

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

Sidebar

Related Questions

For example I have array of (x,y) points and I want to organize them
I have panel that is using group layout to organize some label. I want
I have an archive of Dilbert cartoons, and would like to organize them in
I have some records, that I want to save to database asynchronously. I organize
There have been some discussions on how to organize your #import statements in objective-c.
How do you organize projects when you have hundreds of them? Not layout within
Through the last years I have different types of software to organize my photo
I am trying to organize some modules for my own use. I have something
So lets say I have an array that I want to organize by the
I have some events in my model and some handling logic. I want organize

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.