senooken JP Social
  • FAQ
  • Login
senooken JP Socialはsenookenの専用分散SNSです。
  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

せのお (妹尾 賢) (senooken@social.senooken.jp)'s status on Monday, 02-Jul-2018 20:37:09 JST

  1. せのお (妹尾 賢) (senooken@social.senooken.jp)'s status on Monday, 02-Jul-2018 20:37:09 JST せのお (妹尾 賢) せのお (妹尾 賢)
    わからない。なぜ,これで@が表示されるんだ?

    ///////////////////////////////////////////////////////////////////////////////
    /// \file find_array.c
    /// \author SENOO, Ken
    ///////////////////////////////////////////////////////////////////////////////

    #include <stdio.h>
    #include <search.h>
    #include <string.h>

    int main(void) {
    char *tab[] = {
    "auto",
    "break"
    };

    size_t nel = sizeof(tab)/sizeof(tab[0]);
    // char *target = "break";
    // char *entry = lfind(&target, tab, &nel, sizeof(tab[0]), (int (*)(const void *, const void*))strcmp);
    void *entry = lfind(&(void *){"break"}, tab, &nel, sizeof(tab[0]), (int (*)(const void *, const void*))strcmp);

    if (entry) {
    printf("found: %p\n", (void *)tab);
    printf("found: entry:%p\n", entry);
    printf("found: %s:%p\n", tab[1], (void *)&tab[1]);
    printf("found: %s\n", (char *)entry); // ここが@になる
    } else {
    puts("NOT FOUND");
    }

    return 0;
    }
    In conversation Monday, 02-Jul-2018 20:37:09 JST from web permalink

Feeds

  • Activity Streams
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

senooken JP Social is a social network, courtesy of senooken. It runs on GNU social, version 2.0.2-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All senooken JP Social content and data are available under the Creative Commons Attribution 3.0 license.