【发布时间】:2010-09-25 04:50:48
【问题描述】:
编译这一行
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 行读到两个警告:
warning: conversion lacks type at end of format
warning: too many arguments for format
为什么?指定了类型(long int sz,和 snprintf 中的 %l),并且 snprintf 中的参数只有一个。有谁能够帮我?谢谢。
【问题讨论】: