Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
U

User 11471444

@User 11471444
About
Posts
3
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • please fix my generic function
    U User 11471444

    Thank you so much, it worked very well ^_^ , excuse my ignorance still new in this .

    C / C++ / MFC help data-structures

  • please fix my generic function
    U User 11471444

    Thank you so much, it worked very well ^_^ , excuse my ignorance still new in this .

    C / C++ / MFC help data-structures

  • please fix my generic function
    U User 11471444

    This program doesn't compile and gives me error "Conficting types of L search" . I ran out of all trials and I am so confused why the heck it gives me this error . I would appreciate your contributions to solve my problem . the function does front back search of an array, if any number matches it sends back its address.

    #include <stdio.h>

    int main(void) {
    int arr []= {1,2,3,4,5,6,7,8,9,10} ;
    int req = 5;

    Lsearch(arr,&req,10,4); // (sizeof(arr)/sizeof(int)),sizeof(req)
    
    
    return 0;
    

    }

    void *Lsearch(void *base,void *key,int n,int elemsize)
    {
    for(int i = 0 ; i<n;i++)
    {
    void *elemAddr = (char*)base + i*elemsize ;
    if(memcmp(key,base,elemsize)==0) return elemAddr ;
    }
    return NULL ;
    }</pre>

    C / C++ / MFC help data-structures
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups