hardman
V2EX  ›  算法

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

  •  1
     
  •   hardman · Nov 16, 2017 · 4406 views
    This topic created in 3132 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   ·   5920 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 06:17 · PVG 14:17 · LAX 23:17 · JFK 02:17
    ♥ Do have faith in what you're doing.