hardman
V2EX  ›  算法

codewase 注册题目如何解答 c 语言版本

  •  1
     
  •   hardman · Nov 16, 2017 · 4420 views
    This topic created in 3143 days ago, the information mentioned may be changed or developed.

    int multiply(int a, char *b) { return a b; }

    是题目太难还是太简单了

    1 replies    2017-11-17 11:43:58 +08:00
    hardman
        1
    hardman  
    OP
       Nov 17, 2017
    答案
    return a * (int)b;
    两个数相乘,因为 b 是指针类型之前强制转地址
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1435 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 16:52 · PVG 00:52 · LAX 09:52 · JFK 12:52
    ♥ Do have faith in what you're doing.