[Vala] Sorting Array
- From: michele cremasco <michele cremasco gmail com>
- To: vala-list gnome org
- Subject: [Vala] Sorting Array
- Date: Tue, 20 Apr 2010 16:29:24 +0200
Hallo, I have to little questions:
1) Is there a function to sort arrays without using Posix.qsort?
Example:
int[] arr = { 10, 5, 45, 12 };
Posix.qsort(arr, arr.length, sizeof(int), (pa, pb) => { return
(*(int*)pa) - (*(int*)pb); } );
2) Is there a function to compare two string partially without using
Posix.strncmp ?
Example:
string a = "hallo my friends!";
string b = "hallo people!";
if( Posix.strncmp( a, b, 5) ==0 ) -> wil be true
thanks
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]