Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
mod 4
#include <stdio.h> #include <stdlib.h> int compara(const void *dato, const void *clave) { int *ptrDato = (int *) dato; int *ptrClave = (int *) clave; return (*ptrDato) - (*ptrClave); } int main(void) { int vector[6] = {10,20,30,40,50,60}; int clave = 20; int *ptr = (int *) bsearch(&clave, vector, 6, sizeof(int), compara); int posicion; if (ptr == NULL) printf("%d NO ESTA EN VECTOR ",clave); else { printf("%p\n",ptr); printf("%p\n",vector); posicion = ptr - vector; printf("%d ESTA EN VECTOR en posicion %d",clave,posicion); } return 0; }
run
|
edit
|
history
|
help
0
Simple Calculator v1.0
Búsqueda binaria rec
18BCE2182 LAB FAT-2-A-i
8 trajo semal 4
bit shift and mask
array poi
140114_CribaErasthotenes
Q1.c
linear hybrid cellular automaton reversible random bit generator stream cipher
selection sort