由买买提看人间百态

topics

全部话题 - 话题: sprintf
1 2 3 下页 末页 (共3页)
s*****w
发帖数: 1527
1
【 以下文字转载自 Programming 讨论区 】
发信人: somehow (淡泊明志,宁静致远), 信区: Programming
标 题: How difficult is it to write your own sprintf ?
发信站: BBS 未名空间站 (Mon Jan 31 14:56:10 2011, 美东)
i have the task to write the c runtime at work, funny, right ?
anyway, the sprintf() in BSD is way to complicated.
if i write sprintf("%d"), just find the 1st digit, then keep on going.
for %f, i break into 2 parts, say 3.14
1. print 3,
2. for 0.14, i found it has 2 digits after the 0.
so *100, make it 14, then print 14
for %... 阅读全帖
t****t
发帖数: 6806
2
make up your mind first. it seems you are not clear what you are doing.
(a) if you just want to port, or simplify, sprintf() itself, let me reassure
you it is unrelated to buffer, period. no matter what port you use. it does
not even use a FILE*.
(b) if you want to port BSD libc, that's a different story. libc essentially
has two parts: libc(3) and libc(2). libc(2) is kernel API, it's different
from OS to OS. usually each call is a wrapper to corresponding kernel API.
obviously you have to find ... 阅读全帖
n*******e
发帖数: 4894
3
来自主题: Programming版 - perl sprintf question converting dec to hex
$MACAddress =sprintf("%.8s" ,(sprintf("%08x", $MACAddress)));
也许这是想要的?如果大于八位,就去掉末尾多余的
$MACAddress = sprintf("%08x", $MACAddress) =~ s/.*(\w{8})$/$1/r;
如果想truncate的是前面的,就用上面这种办法
w**2
发帖数: 724
4
【 以下文字转载自 Programming 讨论区 】
发信人: wds2 (阿旺), 信区: Programming
标 题: perl sprintf question converting dec to hex
发信站: BBS 未名空间站 (Wed Mar 4 17:42:19 2015, 美东)
hi i have this line,
$MACAddress = sprintf("%06x", $MACAddress);
1. when $MACAddress was -1, this line converts it to ffffffffffffffff
instead of ffffffff, i'm on a 32-bit linux pc.
why ?
2. in my code, i need to write $MACAddress twice.
how to use some shortcut e.g. $1 ?
Thanks !
BTW, i LOVE Perl, :)
s*****w
发帖数: 1527
5
i have the task to write the c runtime at work, funny, right ?
anyway, the sprintf() in BSD is way to complicated.
if i write sprintf("%d"), just find the 1st digit, then keep on going.
for %f, i break into 2 parts, say 3.14
1. print 3,
2. for 0.14, i found it has 2 digits after the 0.
so *100, make it 14, then print 14
for %e, can convert to %f
....
what else am i missing ?
why do i need to worry about the buffered io, non-buffered io ?
thanks !
t****t
发帖数: 6806
6
for sprintf, why do you care whether it's BSD or gnu?
for sprintf, why do you care line buffered, fully buffered, non buffered?
the underlying FILE* interface do that.
N****w
发帖数: 21578
7
you are talking about sprintf or
sscanf?
s*****w
发帖数: 1527
S*A
发帖数: 7142
9
There are a few sprintf like public domain function
you can copy. MIT or BSD licensed.
If you don't deal with %f and the fancy ones, it is
actually very easy. I even write a version in assembler
before for some boot loader code.
S*A
发帖数: 7142
10
BTW, you really want snprintf instead of sprintf,
which is not safe.
You are dealing with memory buffer, so no IO involved.
t****t
发帖数: 6806
11
what prevents you from peeking at glibc source?
you don't have to copy it, you can just check what you have missed and/or
what dumb thing you have done.
and why do you care io buffering? for sprintf, you are printing to string.
s*****w
发帖数: 1527
12
well, this is a commercial product at work, BSD licence is better.
i don't care about if buffered or not, if i can easily port the code to
windows. But remember the file structure etc. is totally different from
unix to windows, so i have to pray to make the file APIs to work in
windows.
Otherwise i want to modify the BSD code to make sprintf to work, in
which case need to understand the code, that brings in the buffered or
not question.
all i given is 4 weeks to port the whole BSD CRT, i wonder ... 阅读全帖
w**2
发帖数: 724
13
来自主题: Programming版 - perl sprintf question converting dec to hex
hi i have this line,
$MACAddress = sprintf("%06x", $MACAddress);
1. when $MACAddress was -1, this line converts it to ffffffffffffffff
instead of ffffffff, i'm on a 32-bit linux pc.
why ?
2. in my code, i need to write $MACAddress twice.
how to use some shortcut e.g. $1 ?
Thanks !
BTW, i LOVE Perl, :)
e*******o
发帖数: 4654
14
来自主题: Programming版 - perl sprintf question converting dec to hex
1.
➜ perl -MDevel::Peek -E 'Dump(-1)'
SV = IV(0x15f02a0) at 0x15f02b0
REFCNT = 1
FLAGS = (PADTMP,IOK,READONLY,pIOK)
IV = -1
this show -1 is stored as IV internally.
➜ perl -V:ivsize
ivsize='8';
the unit is bytes, so size in bit
ivszie * 8 = 64 .
2. same with C, 1$
http://perldoc.perl.org/functions/sprintf.html
f*******n
发帖数: 12623
15
来自主题: Programming版 - perl sprintf question converting dec to hex
$MACAddress = sprintf("%06x", $MACAddress & 0xffffffff);
d**********o
发帖数: 1321
16
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
hw3b c-.y file
上面这一楼贴了载止hw3b deadline时我match的结果(也就是老师可以以这些不match
的ERROR为借口不给后来我补上的成绩),但是因为当时我还是没有写完,后来感恩节
期间就接着又写了一些,而且hw5是based on hw3 & hw3b的基础上(当我hw5是based
on更好的hw3的结果时,我应该可以得更多的分吧)。
hw4因为写得比较顺利,就不曾保留任何交上去作业的output,没有什么一目了然的结
果是我可以贴在这里的。原本我是想要把自己最的一次作业hw5贴出来的,但那已经是
一个完整的compiler,而且以后我还需要用自己的course project来找工作,所以一定
就不贴最终结果了。那就贴一个hw3b的c-.y文件吧,它集中的hw1、hw2、hw3、 hw3b的
结果,是我自己hw3b *.y文件的最完整版本。这些作业里面也有很多机关一一人为增加
的难度,比如那六七个IO相关的function,不仅traverse tree、build syntax tree的
时候会成为一个考点(把它们作为一个node连在syntax... 阅读全帖
d**********o
发帖数: 1321
17
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
hw3b c-.y file
上面这一楼贴了载止hw3b deadline时我match的结果(也就是老师可以以这些不match
的ERROR为借口不给后来我补上的成绩),但是因为当时我还是没有写完,后来感恩节
期间就接着又写了一些,而且hw5是based on hw3 & hw3b的基础上(当我hw5是based
on更好的hw3的结果时,我应该可以得更多的分吧)。
hw4因为写得比较顺利,就不曾保留任何交上去作业的output,没有什么一目了然的结
果是我可以贴在这里的。原本我是想要把自己最的一次作业hw5贴出来的,但那已经是
一个完整的compiler,而且以后我还需要用自己的course project来找工作,所以一定
就不贴最终结果了。那就贴一个hw3b的c-.y文件吧,它集中的hw1、hw2、hw3、 hw3b的
结果,是我自己hw3b *.y文件的最完整版本。这些作业里面也有很多机关一一人为增加
的难度,比如那六七个IO相关的function,不仅traverse tree、build syntax tree的
时候会成为一个考点(把它们作为一个node连在syntax... 阅读全帖
S******t
发帖数: 151
18
来自主题: JobHunting版 - 问个IQ 题
#include
#include
using namespace std;
char cross[3000][20];
int main()
{
int n,i,nc=0,sum=0,t[1000];
scanf("%d",&n);
for(i=0;i scanf("%d",&t[i]);
sort(t,t+n);
for(i=n-1;i>=3&&2*t[1] {
sprintf(cross[nc++],"%d %d\n",t[0],t[1]);
sprintf(cross[nc++],"%d\n",t[0]);
sprintf(cross[nc++],"%d %d\n",t[i-1],t[i]);
sprintf(cross[nc++],"%d\n",t[1]);
sum+=2*t[1]+t[0]+t[i];
}
for(;i>=2;i... 阅读全帖
y****e
发帖数: 1012
19
来自主题: Mathematics版 - 能问大家几个数值分析的问题吗?
大家过年好~~有几个题目不是很清楚~
给了几段matlab程序,问题问发生了什么问题?
1.
close all
k=0;
n=100;
for delta = [.1 .01 .008 .007 .005 .003 ]
x = linspace(1-delta,1+delta,n)';
y = x.^6 - 6*x.^5 + 15*x.^4 - 20*x.^3 + 15*x.^2 - 6*x + ones(n,1);
k = k+1;
subplot(2,3,k)
plot(x,y,x,zeros(1,n))
axis([1-delta 1+delta -max(abs(y)) max(abs(y))])
end
2.
% p = smallest positive integer so 1+1/2^p = 1.
x=1; p=0; y=1; z=x+y;
while x~=z
y=y/2;
p=p+1;
z=x+y;
end
disp(sprintf('p = %2.0f is the smallest positive ... 阅读全帖
f*******a
发帖数: 663
20
来自主题: DataSciences版 - Science上新clustering算法的分析测试
开始忘贴代码了,有朋友要求,就把修改后的代码贴在这里。改动不多,可以部分提升
效率。原来的也没删,注释掉了。供参考。
=========================================================================
clear;
close all
disp('The only input needed is a distance matrix file')
disp('The format of this file should be: ')
disp('Column 1: id of element i')
disp('Column 2: id of element j')
disp('Column 3: dist(i,j)')
if(0)
% mdist=input('name of the distance matrix file (with single quotes)?\n'
);
mdist = 'example_distances.dat';

disp('Reading input dis... 阅读全帖
j****9
发帖数: 2295
21
来自主题: JobHunting版 - 下面的code怎么样improve?
Sprintf(buffer,"%c",ESC);
Send(buffer);
Sprintf(buffer,"%s",message);
Send(buffer);
Sprintf(buffer,"rn");
Send(buffer);
c*****t
发帖数: 1879
22
来自主题: Database版 - Mysterious PgSQL 8.3 crash
写 stored procedure 的时候,发现 sprintf, elog, ereport 等统统
会造成 crash 。可是 8.2.6 底下好好的。比如
strcpy (buffer, "test"); 执行没问题,但是
sprintf (buffer, "%s", "test"); 就 crash。
例如:
CREATE FUNCTION TCDB.t_create_table(cstring) RETURNS void
AS '/projects/workspace/tcdb/src/server/libmy_utils.dll', 't_create_table'
LANGUAGE C STRICT;
Datum t_create_table (PG_FUNCTION_ARGS)
{
char buffer[8192];
sprintf (buffer, "%s", "test"); // 这一行 crash
// strcpy (buffer, "test"); 没问题
puts (buffer
j****9
发帖数: 2295
23
来自主题: Programming版 - 下面的code怎么样improve?
Sprintf(buffer,"%c",ESC);
Send(buffer);
Sprintf(buffer,"%s",message);
Send(buffer);
Sprintf(buffer,"rn");
Send(buffer);
j****9
发帖数: 2295
24
来自主题: EE版 - 下面的code怎么样improve?
Sprintf(buffer,"%c",ESC);
Send(buffer);
Sprintf(buffer,"%s",message);
Send(buffer);
Sprintf(buffer,"rn");
Send(buffer);
f****g
发帖数: 313
25
来自主题: JobHunting版 - A simple interview question
The following is my code :S
#include
#include
#include
#define MAXLEN 5
char* countCharInStr(const char* s,
unsigned int len)
{
char *pFast, *pSlow;
unsigned char num[MAXLEN] = {0};
unsigned int count = 0;
unsigned int resC = 0;

if( 0 == len || NULL == s)
{
return NULL;
}

char *res = (char*)malloc(sizeof(char)*len);
if( NULL == res)
{
return NULL;
}

pSlow = s;
pFa... 阅读全帖
p********s
发帖数: 37
26
来自主题: JobHunting版 - 那个24 game given 4 number用= - × /的题
写了个超级傻的,各种没效率,您别笑话囧
int pl(int a, int b) { return a + b; }
int mi(int a, int b) { return a - b; }
int ti(int a, int b) { return a * b; }
int di(int a, int b) { return (b && !(a % b)) ? (a / b) : -12345 ; }
int (*op[4])(int a, int b) = {&pl, &mi, &ti, &di};
const char *name[4] = {"+", "-", "*", "/"};
char result[128] = {0};
bool tryit(int nums[], char* res)
{
char result[128];
for(int i = 0; i < 4; i++)
for(int j = 0; j < 4; j++)
for(int k = 0; k < 4; k++)
if ((*op[k])((*op[j])((*op... 阅读全帖
p********s
发帖数: 37
27
来自主题: JobHunting版 - 那个24 game given 4 number用= - × /的题
写了个超级傻的,各种没效率,您别笑话囧
int pl(int a, int b) { return a + b; }
int mi(int a, int b) { return a - b; }
int ti(int a, int b) { return a * b; }
int di(int a, int b) { return (b && !(a % b)) ? (a / b) : -12345 ; }
int (*op[4])(int a, int b) = {&pl, &mi, &ti, &di};
const char *name[4] = {"+", "-", "*", "/"};
char result[128] = {0};
bool tryit(int nums[], char* res)
{
char result[128];
for(int i = 0; i < 4; i++)
for(int j = 0; j < 4; j++)
for(int k = 0; k < 4; k++)
if ((*op[k])((*op[j])((*op... 阅读全帖
l*********o
发帖数: 3091
28
来自主题: JobHunting版 - 问下LeetCode上的题目:count and say
#include
#include
int convert(char* src, char* dst)
{
*dst = 0;
int pos;
char str[64];
while(*src)
{
if(*src < '0' || *src > '9') return 1;
pos = 1;
while(*src==*(src+pos))pos++;
sprintf(str, "%d", pos);
strcat(dst, str);
dst += strlen(str);
sprintf(str, "%c", *src);
strcat(dst, str);
dst += strlen(str);
src += pos;
}
return 0;
}
int main()
{
int n = 29;
int... 阅读全帖
f**********t
发帖数: 1001
29
Well, my code is complex and sigfault. Let me go back if I have time.
This is too hard for a 45 minutes interview.
void skipSpace(const char **s) {
while (isspace(**s)) {
++(*s);
}
}
int getNum(const char **s) {
bool neg = false;
if (**s == '-') {
neg = true;
++(*s);
}
int cur = 0;
while (isdigit(**s)) {
cur = cur * 10 + (**s - '0');
++(*s);
}
--(*s);
return neg ? -cur : cur;
}
int opNum(int x, int y, char op) {
switch (op) {
case '+':
return x + y... 阅读全帖
x****o
发帖数: 21566
30
【 以下文字转载自 Linux 讨论区 】
发信人: wjk302 (akui), 信区: Linux
标 题: 大家能帮我看一下下面的问题吗,不胜感激。
发信站: BBS 未名空间站 (Wed Feb 1 22:05:13 2012, 美东)
很冒昧的打扰大家。大家能帮我看一下下面的问题吗,不胜感激。
问题是这样的,在生产环境下
1、Suse的Linux有 /nfsmnt/work_pub/web 文件夹和 /nfsmnt/work_inwork/web
文件夹 ,它们都是NFS文件挂载
2、机器上有多个进程会读写/nfsmnt/work_pub/web 文件夹的内容
3、cron会周期性的 删除/nfsmnt/work_pub/web 文件夹下所有文件,并把/nfsmnt/
work_inwork/web 文件夹下的所有内容拷贝到前面那个文件夹中
这样,完全删除/nfsmnt/work_pub/web 文件夹下所有文件的时候就会有.nfs文件删除
不掉(上面的流程因为某些问题不方便改动)。
想咨询的问题是:我现在能不能修改一下fs/nfs/dir.c ... 阅读全帖
w****2
发帖数: 2
31
很冒昧的打扰大家。大家能帮我看一下下面的问题吗,不胜感激。
问题是这样的,在生产环境下
1、Suse的Linux有 /nfsmnt/work_pub/web 文件夹和 /nfsmnt/work_inwork/web
文件夹 ,它们都是NFS文件挂载
2、机器上有多个进程会读写/nfsmnt/work_pub/web 文件夹的内容
3、cron会周期性的 删除/nfsmnt/work_pub/web 文件夹下所有文件,并把/nfsmnt/
work_inwork/web 文件夹下的所有内容拷贝到前面那个文件夹中
这样,完全删除/nfsmnt/work_pub/web 文件夹下所有文件的时候就会有.nfs文件删除
不掉(上面的流程因为某些问题不方便改动)。
想咨询的问题是:我现在能不能修改一下fs/nfs/dir.c 中 nfs_sillyrename这个方法
,把所有.nfs文件生成到/nfsmnt/temp目录下,然后重新编译内核解决上面的问题?期
待大家的指点,先谢谢了。
下面是源代码
static int nfs_sillyrename(struct in... 阅读全帖
c*****t
发帖数: 1879
32
来自主题: Programming版 - Mysterious PgSQL 8.3 crash
【 以下文字转载自 Database 讨论区 】
发信人: coconut (向唐僧大师学习中), 信区: Database
标 题: Mysterious PgSQL 8.3 crash
发信站: BBS 未名空间站 (Fri Feb 8 12:32:47 2008), 站内
写 stored procedure 的时候,发现 sprintf, elog, ereport 等统统
会造成 crash 。可是 8.2.6 底下好好的。比如
strcpy (buffer, "test"); 执行没问题,但是
sprintf (buffer, "%s", "test"); 就 crash。
例如:
CREATE FUNCTION TCDB.t_create_table(cstring) RETURNS void
AS '/projects/workspace/tcdb/src/server/libmy_utils.dll', 't_create_table'
LANGUAGE C STRICT;
Datum t_create_table (PG_FUNCTION_ARGS)
{
t****t
发帖数: 6806
33
来自主题: Programming版 - 请教Matlab和IDL的处理数据能力差异
嗯, 这回我看明白了
可以这样写
for procID=0:(numProcs-1)
fileName = sprintf('%d-DATA.dat', procID);
data = fopen(fileName, 'r');
if data ~= -1
numFreqs = fread(data, 1, 'long');
numLocations = fread(data, 1, 'long');
pos=ftell(data);
xyz=fread(data, [3 numLocations], "3*long", numFreqs*3*2*8)+1;
fseek(data, pos+3*4, -1);
dataformat=sprintf('%d*double', 2*3*numfreqs);
Exyz=fread(data, [2 3*numfreqs*numLocations], dataformat, 3*4);
Exyz=complex(Exyz(1,:), Exyz(2,:));
Exyz=reshape(Exyz, [numFreqs 3 numLocations]
w***g
发帖数: 5958
34
来自主题: Programming版 - two general C++ question
sprintf和system也是标准的C++函数,只不过要用.虽然他们不是
面向对象的,但是他们和cin, cout一样写在了C++标准中。boost::format是sprintf的
一个比较好的替代品。

in
g****y
发帖数: 436
35
来自主题: Programming版 - 无法编译一个文件
一个cpp文件的头部:
#include "BEDFileData.h"
#include
using namespace std;
using namespace affxbed;
#pragma warning(disable: 4996)
然后中间有用到 strlen之类的函数,比如:
void BEDFileData::FormatTrack(const char *name, const char *desc)
{
char line[256];
if (desc && strlen(desc) > 0)
sprintf(line, "%s\"%s\" description=\"%s\"", TRACK_LINE_
START, name, desc)
;
else
sprintf(line, "%s\"%s\"", TRACK_LINE_START, name);
track=line;
}
编译的时候,报错说:
error:
n****u
发帖数: 467
36
来自主题: Programming版 - 帮忙找个错
#include
int main(){
char *s="test";
sprintf(s,"t");
printf("%s\n",s);
}
Bus error。C 的小例子,是先初始化,然后想用sprintf重新赋值。
s****n
发帖数: 700
37
来自主题: Programming版 - C++: use char * in Map
I get some problem here.
char a[40];
char b[40];
sprintf(a, "%s", "x1");
sprintf(b, "%s", "x2");

struct cmp_str
{
bool operator()(char const *a, char const *b)
{
return strcmp(a,b) < 0;
}
};

typedef std::map MAPIDS;
MAPIDS m_mapIds;
std::pair< MAPIDS::iterator, bool > _pr_id = m_mapIds.insert( MAPIDS::value_
type(a , b ));
printf("%s %s\n", _pr_id.first, _pr_id.second // look likes I can't
retrieve a and b using the pair... 阅读全帖
m********r
发帖数: 334
38
这段程序读boa的配置文件boa.conf,找到端口号后改写新端口,例如
Port 80
# Listen: the Internet address to bind(2) to. If you leave it out,
# it takes the behavior before 0.93.17.2, which is to bind to all
# addresses (INADDR_ANY). You only get one "Listen" directive,
变成Port 8080
# Listen: the Internet address to bind(2) to. If you leave it out,
# it takes the behavior before 0.93.17.2, which is to bind to all
# addresses (INADDR_ANY). You only get one "Listen" directive,
现在发现每次第一次修改的时候这一行没问题,但是下面的注释的#号没有了,变成
n: the I... 阅读全帖
x******a
发帖数: 6336
39
来自主题: Programming版 - C++ problem
I got thousands problems on the following piece of code "dumpfile.h" when I
compile under cygwin. it is ok under visual stduio... can anyone help?
Thanks!
#include
#include
#include //ostream_iterator
#include //cerr
#include //std::copy
template
void dump_to_file(const char* filename, const std::vector& v_d){
std::ofstream ofs(filename);
if(!ofs){
std::cerr<<"Unable to open the file to write!n";
return ;... 阅读全帖
I**********s
发帖数: 441
40
来自主题: Unix版 - Unix上C++函数求救
If you check C reference book you can find many ways to do
this, I think.
One way currently I'm using is sprintf function:
char intString[20];
int n = 10;
sprintf(intString, "%d", n);
then you can use intString other places.
e***o
发帖数: 14
41
use "sprintf".
man sprintf for details...
p******f
发帖数: 162
42
来自主题: Unix版 - PERL入门求助
"0x%04x" for sprintf
perldoc -f sprintf
P******d
发帖数: 137
43
来自主题: Statistics版 - 请问如何用JDBC连接R和Hive
因为平时都是在Hive下把数据先从Hadoop中提取出来,放到AWS的S3里面,再下载到自
己的电脑上。我想要尝试直接连接R和Hive,用JDBC Driver。
在stackoverflow上找到这个帖子:
http://stackoverflow.com/questions/6057875/establishing-a-conne
但是我在自己尝试的时候,老是出现错误
Error in .jfindClass(as.character(driverClass)[1]) : class not found
这是我的Code:
hive_connection <- function(hostname='myhostname',
port= myportnumber,
lib_dir="my/dir" ){
hive_jars <- c('commons-logging-1.1.3.jar',
'hadoop-core-1.2.1.jar',
... 阅读全帖
P******d
发帖数: 137
44
来自主题: DataSciences版 - 请问如何用JDBC连接R和Hive (转载)
【 以下文字转载自 Statistics 讨论区 】
发信人: PlayCold (玩酷), 信区: Statistics
标 题: 请问如何用JDBC连接R和Hive
发信站: BBS 未名空间站 (Mon Jan 13 14:48:18 2014, 美东)
因为平时都是在Hive下把数据先从Hadoop中提取出来,放到AWS的S3里面,再下载到自
己的电脑上。我想要尝试直接连接R和Hive,用JDBC Driver。
在stackoverflow上找到这个帖子:
http://stackoverflow.com/questions/6057875/establishing-a-conne
但是我在自己尝试的时候,老是出现错误
Error in .jfindClass(as.character(driverClass)[1]) : class not found
这是我的Code:
hive_connection <- function(hostname='myhostname',
port= myportnumber,
... 阅读全帖
p*****i
发帖数: 1183
45
来自主题: WorldNews版 - 微软确实是不行了
linux实在没有什么安全性可言吧,一堆root权限的程序都还在用sprintf这类不安全函
数呢
就是目前没人惜得去攻击而已.

这也
然是
s*****n
发帖数: 350
46
来自主题: JobHunting版 - 请教一个bloomberg题目
sprintf( buf, "%f\n", var)
s*********t
发帖数: 1663
47
来自主题: JobHunting版 - float的格式化打印
sprintf
s*********t
发帖数: 1663
48
来自主题: JobHunting版 - 补 ms onsite 面筋
ding
总看到itoa的题目,弱弱地问一下,是不是sprintf,ssteram之类的都不许用?
第四个题没想法

(
algorithm
l***i
发帖数: 1309
49
来自主题: JobHunting版 - 面经-facebook, amazon,telenav, quantcast
you can easily get into integer overflow if you use atoi, and you have to
use itoa or sprintf if you do it that way.
a*********9
发帖数: 523
50
来自主题: JobHunting版 - Python 里有类似 Sprintf 的函数么?
输出用 print "%s ..." % [something],
如果想把输出内容放到STRING里可以怎样做呢?
1 2 3 下页 末页 (共3页)