字符串大小函数的行为怪异还是我做错了什么?

时间:2019-06-22 15:36:12

标签: c++ string freeswitch c-str

我得到了错误的drawHealthbar()大小值。

std::string

输出为:

statsd_link* statsd_init(std::string& host, int port) {
    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
         "statsd_init print data to %s:%d and length: %ld, %ld\n", 
             host.c_str(), port, strlen(host.c_str()), host.size());
}

0 个答案:

没有答案