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 7173867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:54:51+00:00 2026-05-28T15:54:51+00:00

I created a generic vector: typedef struct vector_t { int max; /* max number

  • 0

I created a generic vector:

typedef struct vector_t
 {
  int max;     /* max number of elements */
  int size;    /* number of elements present into the array */
  void **data; /* array of elements */

 };

I’d like to know if in standard Ansi-C exists a function for searching a specific element if the array is not sorted. (I know bsearch if the array is sorted).

I have to create my own function?

Thanks.

  • 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-28T15:54:52+00:00Added an answer on May 28, 2026 at 3:54 pm

    If your data isn’t sorted, then “searching” would be just be a for loop that goes through the elements and compares with the search value. If you’re going to be searching often, then you should probably sort your data. There are standard functions for doing the sorting, like qsort()

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

Sidebar

Related Questions

Hi i have created a Generic Array that works fine for Int,String, Float or
I want functionality similar to the below: typedef int A; typedef int B; struct
We've created a generic method like so: public TReturnType GetValue(string key) { var configurationParameter
I recently created a generic Matrix<T> class that acts as a wrapper around a
I've created a web service that uses a generic type Response<TCode, TData> and so
Fun with enums in C#. Take one generic list that is created to store
I have a templated class Vector<class T, int N> Where T is the type
I have created a Generic Extension method for DataRow object. The method takes no
I have created a generic behavior that encapsulates tcp/ip functionality. All the user of
I'm wondering if anyone has created a generic busy box type control for ASP.NET

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.