编译这一行
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 中的参数只有一个。有谁能够帮助我?谢谢。