編譯此行警告()在C++
long int sz;
char tmpret[128];
//take substring of c, translate in c string, convert to int,
//and multiply with 1024
sz=atoi(c.substr(0,pos).c_str())*1024;
snprintf(tmpret,128,"%l",sz);
我看了兩個警告上的snprintf線使用的格式字符串與sprintf的:
warning: conversion lacks type at end of format
warning: too many arguments for format
爲什麼?指定了類型(snprintf中的long int sz和%l),並且snprintf中的參數只有一個。有誰能夠幫助我?謝謝。
沒錯!非常感謝:D – Emilio 2008-12-03 19:33:18