Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 637 results for
qsort
- Page 1
Re: qsort Confusion
Programming
Software Development
16 Years Ago
by Ancient Dragon
>>
qsort
(array[c], length, sizeof(int), compare); that is incorrect. You … array of char pointers not an array of integers [icode]
qsort
(array, c, sizeof(char*), compare);[/icode] Your compare function is…
qsort
Programming
Software Development
16 Years Ago
by Ancient Dragon
…strings such as [icode]char array[255][20][/icode]
qsort
works ok as expected. But if I declare the …array like this
qsort
fails: [icode]char*array[255][/icode] [code] // this… NumStrings = 0; // fill in the array is not shown here
qsort
(array, NumStrings, sizeof(array[0]), compare); [/code] or [code]…
Re: qsort
Programming
Software Development
16 Years Ago
by Beair.GQ
// fill in the array is not shown here
qsort
(array, NumStrings, sizeof(array[0]), compare); here,"sizeof(array[0])" is 20bytes; // fill in the array is not shown here
qsort
(array, NumStrings, sizeof(array[0]), compare); but here,"sizeof(arry[0])" arry[0] is a pointer,so it's mean 4bytes
Re: qsort
Programming
Software Development
16 Years Ago
by Ancient Dragon
… ","good"}; c = sizeof(_array)/sizeof(_array[0]);
qsort
(_array,c, sizeof(char*),compare); cout << "\n…
Qsort
Programming
Software Development
16 Years Ago
by patsfan4878
… to complete the bubblesort portion of the book but the
Qsort
is still giving me a bit of an issue. Basically…
Re: Qsort
Programming
Software Development
16 Years Ago
by patsfan4878
… to complete the bubblesort portion of the book but the
Qsort
is still giving me a bit of an issue. Basically…
Re: Qsort
Programming
Software Development
16 Years Ago
by Aia
… done anything to it. You are asking for help about
Qsort
. Please, post any tries that you have done by yourself…
qsort on array of pointer to structure
Programming
Software Development
14 Years Ago
by logicalguy
…value called id. I want to use
qsort
to sort this array of pointers to … { *(mboo+i) = &master[i]; } printf("\nbefore
qsort
\n"); for (i = 0; i < count; i++)…(**(mboo+i)).id, (**(mboo+i)).size); }
qsort
(mboo, count, sizeof(struct mys*), indirectstructsortbyid); printf("\nafter…
Re: qsort on array of pointer to structure
Programming
Software Development
14 Years Ago
by Adak
… of them need casting like the
qsort
() version. I'd like to see some
qsort
examples that eliminate casting to and… from the call to
qsort
, and it's compare function. When you want to sort… you do is cast the string array to type void *:
qsort
((void *) strArray, . . . Then the compare function has to cast …
Re: qsort on array of pointer to structure
Programming
Software Development
14 Years Ago
by Dave Sinkula
…[QUOTE=Adak;1148021]I'd like to see some
qsort
examples that eliminate casting to and from the call …to
qsort
, and it's compare function.[/quote] Sure: [CODE]#…:"); show(data, addr, count); [COLOR="Red"]
qsort
(addr, count, sizeof *addr, indirec_by_id); [/COLOR] puts("…
qsort structs' strings (C)
Programming
Software Development
13 Years Ago
by chester1908
… const int myCompare (const void *a, const void *b) ; void
qsort
(void *base, size_t count, size_t size, int (*comp)(const void… ->\n"); size_t structs_len = sizeof(catalogue) / sizeof(struct catPage);
qsort
(catalogue,structs_len,sizeof(struct catPage),myCompare); for (i=0;i…
qsort Confusion
Programming
Software Development
16 Years Ago
by picklesandmayo
… sort multiple words alphabetically using [TEX]
qsort
()[/TEX]. I have been using examples of [TEX]
qsort
()[/TEX] found on the web and…;< endl; array[c] = token; token = strtok(NULL,delim); c++; }
qsort
(array[c], length, sizeof(int), compare); cout << "…
qsort question
Programming
Software Development
15 Years Ago
by lehe
Hi, I am sorting an double array, using
qsort
() #include<stdio.h> #include<stdlib.h&…>= * (double** ) arg2 ); } .... int main(int argc,char *argv[]){ ...
qsort
(array, size_ct,sizeof(double),compar); ... } It turns out that the…you point out why it is wrong? And is
qsort
() in C standard library and available in both Windows …
Re: qsort on array of pointer to structure
Programming
Software Development
14 Years Ago
by Adak
… the compare function, is one reason I dislike C's
qsort
. Sure, it's nice for different kinds of data, but…
Re: qsort on array of pointer to structure
Programming
Software Development
14 Years Ago
by Dave Sinkula
… the compare function, is one reason I dislike C's
qsort
. Sure, it's nice for different kinds of data, but…
Re: qsort structs' strings (C)
Programming
Software Development
13 Years Ago
by nezachem
… fills up the global one; which one is passed to
qsort
, I have no idea. Verify it with the debugger. On… whole array. On another side note, why are you redeclaring
qsort
? It is already declared in stdlib.h.
Re: qsort structs' strings (C)
Programming
Software Development
13 Years Ago
by chester1908
hey nez.Thanks for fast reply.Although you are right,no line 28 doesn't cause the problem. But you may be right. If the
qsort
function could not be executed for some reason (eg wrong comp function) i would get compiler error.But i dont get any so
qsort
must be used on some other (?) array..Any suggestions?
Re: qsort Confusion
Programming
Software Development
16 Years Ago
by picklesandmayo
…;< endl; array[c] = token; token = strtok(NULL,delim); c++; }
qsort
(array, c, sizeof(char*), compare); cout << "\n…
qsort() function help
Programming
Software Development
15 Years Ago
by coderoobie
:'( Hi geeks!, since I started programming I have never used
qsort
() for sorting. I also tried to consult books but, 'little or no success!'. Can anyone who know better help me to understand
qsort
() function. Please do it with an example! Happy forever even faced with c++!
Re: qsort question
Programming
Software Development
15 Years Ago
by ArkM
…, it's incorrect result because your compar is wrong. Read
qsort
specification carefully. That's a quote from the C language…
qsort with array of structures in c giving a segmentation fault
Programming
Software Development
12 Years Ago
by benclifford
…order. I am hoping I can do this using the
qsort
function but this is giving a segmentation fault. I …; } addSmurfToVillage(&num_elements, &temp_array, village); num_elements++; } close(fp);
qsort
(village, num_elements, sizeof(SMURF), cmpr); batchCount(&num_elements, village, &…
Qsort with structs using double as the pivot
Programming
Software Development
11 Years Ago
by Kirielson
Hello everyone, I'm trying to implement
qsort
on a struct with the double as a pivot: typedef … -1; if (x > y) return 1; else return 0; } ...
qsort
(x,k,sizeof(tuple),compare); Now I was trying to…
Re: qsort() function help
Programming
Software Development
15 Years Ago
by jencas
Take a look at [url]http://www.cplusplus.com/reference/clibrary/cstdlib/
qsort
.html[/url]
Re: qsort() function help
Programming
Software Development
15 Years Ago
by coderoobie
[QUOTE=jencas;675529]Take a look at [url]http://www.cplusplus.com/reference/clibrary/cstdlib/
qsort
.html[/url][/QUOTE] Wot a quick reply! Thanks jencas I 'l have a look at it. One more question, Can I sort a listbox containing strings? :icon_cool:
Re: Qsort with structs using double as the pivot
Programming
Software Development
11 Years Ago
by tinstaafl
…[i].prob << ","; cout << endl;
qsort
(testarray,3,sizeof(test),compare); for(int i=0;i…
Qsort Pointer To Arrays Of Structs
Programming
Software Development
16 Years Ago
by stolson
…); 97 } 98 void sort(ADDRESS *a, int *i) 99 { 100
qsort
(a, *i, sizeof(ADDRESS),compare); 101 } 102 103 104 int…
Re: Qsort Pointer To Arrays Of Structs
Programming
Software Development
16 Years Ago
by stolson
… zip; } ADDRESS; and then: void sort(ADDRESS *a, int *i) {
qsort
(a, *i, sizeof(struct pb_s),compare); } int compare(const void…
Qsort an array of structures by 2 criteria
Programming
Software Development
12 Years Ago
by The 42nd
… array} print_struct_array(structs, structs_len); puts("*** Struct sorting (name)...");
qsort
(structs, structs_len, sizeof(struct record), function_comparing_names); print_struct_array(structs, structs_len); } int…
Re: Qsort an array of structures by 2 criteria
Programming
Software Development
12 Years Ago
by Narue
…;, 3}, {"C", 1} }; int size = 6; int i;
qsort
(records, size, sizeof(*records), compare); for (i = 0; i <…
qsort() in struct
Programming
Software Development
11 Years Ago
by VergilDevil123
…. resztvevo adatai: ", i); olvas(&t); tomb[i]=t; }
qsort
(tomb, n, sizeof (tomb[0]), sort_age); for (i=1;i…
1
2
3
11
Next
Last
Search
Search
Forum Categories
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Forums
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC