字符串变量中使用的宏定义

时间:2016-05-23 03:20:27

标签: c++ c

我想实现这个目标:

public static boolean isClientReachable(Client client, int timeout){
    try{
        return InetAddress.getByName(client.getIpAddress()).isReachable(timeout);
    }catch (Exception e){
        e.printStackTrace();
    }
    return false;
}

y = STR_HELLO_LEN,但是STR_tmp_LEN

1 个答案:

答案 0 :(得分:2)

这是不可能的。所有宏都在编译时解析。 “hello”仅在运行时存在。

相关问题