User Profile
Collapse
-
thank you for your Healp .I've already found a solution with you Help and the Help of Other Programmer on stackoverflow . I'm still a beginner in c that's why there is a lot that i have to learn. I appreciate your Help
this is a working version of what i am trying to do
Code:#include <stdio.h> #include <stdlib.h> #include <string.h> struct Vehicle { char *manufacturer;
Leave a comment:
-
thank you for replying
I've tried to sort the array of pointer just by swapping the pointers inside it . it will be easier . i 've used the qsort funtion but without success
Code:int compare(const void *a, const void *b) { struct Vehicle * const *one = a; struct Vehicle * const *two = b; return strcmp((*one)->serialnumber, (*two)->serialnumber); } void SortByID(struct Vehicle** data, int Anzahl){
Leave a comment:
-
yassinov started a topic Sorting an array of pointers to struct based on an element inside the structin CSorting an array of pointers to struct based on an element inside the struct
Hi everyone . I'm still a beginner in C especially with structures and pointers. So what i want to do here is to sort an Array of pointers to Structs based on a string inside the Struct . All the Element are dynamically allocated . And i want to know how to free the allocated Memory . My code is written in German so i will be writing only the parts that i don't understand in English . thank you in advance I appreciate your help.
...
No activity results to display
Show More
Leave a comment: