由买买提看人间百态

topics

全部话题 - 话题: fputs
(共0页)
v******n
发帖数: 421
1
来自主题: Programming版 - Ruby 为什么输给了py
FPUTS(3) FreeBSD Library Functions Manual FPUTS(
3)
NAME
fputs, puts -- output a line to a stream
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include
int
fputs(const char *str, FILE *stream);
int
puts(const char *str);
DESCRIPTION
The function fputs() writes the string pointed to by str to the stream
pointed to by stream.
The function puts() writes the string str, and a terminating newline
character... 阅读全帖
v******n
发帖数: 421
2
来自主题: Programming版 - Ruby 为什么输给了py
FPUTS(3) FreeBSD Library Functions Manual FPUTS(
3)
NAME
fputs, puts -- output a line to a stream
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include
int
fputs(const char *str, FILE *stream);
int
puts(const char *str);
DESCRIPTION
The function fputs() writes the string pointed to by str to the stream
pointed to by stream.
The function puts() writes the string str, and a terminating newline
character... 阅读全帖
R*****i
发帖数: 2126
3
来自主题: JobHunting版 - 一道老题目, 求最快捷解法
这个题目建议用红黑树做可能最快捷有效。红黑树每一次插入,删除都是log(k),求平
均值非常简单,就是根部的那个节点。所以总的计算量是O(nlog(k))。
以下是c/c++代码(需要修改数组,以便一个一个输入)。
#include
#include
#include
#define INDENT_STEP 4
enum rbtree_node_color {RED, BLACK};
typedef struct rbtree_node_t {
int value;
struct rbtree_node_t* left;
struct rbtree_node_t* right;
struct rbtree_node_t* parent;
enum rbtree_node_color color;
} *rbtree_node;
typedef rbtree_node node;
typedef enum rbtree_node_color color;
typedef struct... 阅读全帖
x******a
发帖数: 6336
4
来自主题: 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 ;... 阅读全帖
m********r
发帖数: 334
5
这段程序读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... 阅读全帖
w*s
发帖数: 7227
6
来自主题: Programming版 - file modification questions in linux using c
i typed a lot in chinese but it's gone, :(
anyway, say i have a file has 3 lines,
1: i
2: love
3: coding
now i want to modify the 2nd line,
1: i
2: don't love
3: coding
i can use fgets to read each line, then use fputs to write all 3 lines back.
but it's a waste, can i just write the 2nd line pack ?
the issue is the length of 2nd line get changed.
any way to make it better ?
thanks so much !
l*********s
发帖数: 5409
7
来自主题: Programming版 - file modification questions in linux using c
lseek / fputs
z****e
发帖数: 54598
8
来自主题: Programming版 - Ruby 为什么输给了py
well
我已经把put这个动词应该的用处说了
如果还是不理解的话
那就具体一个例子
map.put是最直观的
puts用来表达print给人感觉怪怪的
c这么做未必代表其正确
只能说不可避免的是所有东西都带有c的痕迹
不同的人会作出不同的选择
这就好像公孙大神说的,你要这么说,我们所有东西都可以归到c去

FPUTS(
z****e
发帖数: 54598
9
来自主题: Programming版 - Ruby 为什么输给了py
well
我已经把put这个动词应该的用处说了
如果还是不理解的话
那就具体一个例子
map.put是最直观的
puts用来表达print给人感觉怪怪的
c这么做未必代表其正确
只能说不可避免的是所有东西都带有c的痕迹
不同的人会作出不同的选择
这就好像公孙大神说的,你要这么说,我们所有东西都可以归到c去

FPUTS(
i*o
发帖数: 149
10
来自主题: Unix版 - help on building shared object
To build a shared object( .so file),I used following commond:
gcc -fPIC -shared -o output.so input.c
and foo( ) is a function defined in input.c
In order to call foo, I did following in calling process:
void * handle = dlopen("output.so",RTLD_LAZY);
if((error=dlerror())!=NULL){
fputs(error,stderr);
exit(1);
}
foo = dlsym(handle,"foo");
foo()...
However, I got result:
./output.so: undefined symbol: foo
I am pretty sure the problem is from the shared object output.so which was not
D******n
发帖数: 2836
11
来自主题: Statistics版 - 新手问个问题 (转载)
create a .vim directory under you home directory(there is a dot before
vim)
and then create a syntax directory under it
and then create a sas.vim file under the syntax directory
==============sas.vim======================
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
syn case ignore
syn region sasString start=+"+ skip=+\\|\"+ end=+"+
syn region sasString start=+'+ skip=+\\|\"+ end=+'+
" Want region from 'cards;' to ';' to be captured (Bob Heckel)
sy... 阅读全帖
(共0页)