s*a
2 楼
有一个小项目,一两个月的时间 part time 即可。但是需要有足够经验可以
自己从零架构起来的。请大家推荐或者自荐。报酬可议。
自己从零架构起来的。请大家推荐或者自荐。报酬可议。
m*t
3 楼
say I have two functions:
void testFunc(int &i, int &j) {
//some complex operation to get both x and y
i = x;
j = y; //getting y is cheap if x is computed
}
void testFunc(int &i) {
// some complex operation to get x
i = x;
}
then i have some call testFunc(i), some call testFunc(i, j).
I am wondering if I should write testFunc(int &i) as this:
void testFunc(int &i) {
int junk;
testFunc(i, junk);
}
feel it is really ugly but i donot want duplicate the code to calculate x.
Any id
void testFunc(int &i, int &j) {
//some complex operation to get both x and y
i = x;
j = y; //getting y is cheap if x is computed
}
void testFunc(int &i) {
// some complex operation to get x
i = x;
}
then i have some call testFunc(i), some call testFunc(i, j).
I am wondering if I should write testFunc(int &i) as this:
void testFunc(int &i) {
int junk;
testFunc(i, junk);
}
feel it is really ugly but i donot want duplicate the code to calculate x.
Any id
e*a
5 楼
it depends on how i and j are related.
why not include testFunc(i) in testFun(i,j) or add an helper function for
both of them?
【在 m***t 的大作中提到】
: say I have two functions:
: void testFunc(int &i, int &j) {
: //some complex operation to get both x and y
: i = x;
: j = y; //getting y is cheap if x is computed
: }
: void testFunc(int &i) {
: // some complex operation to get x
: i = x;
: }
why not include testFunc(i) in testFun(i,j) or add an helper function for
both of them?
【在 m***t 的大作中提到】
: say I have two functions:
: void testFunc(int &i, int &j) {
: //some complex operation to get both x and y
: i = x;
: j = y; //getting y is cheap if x is computed
: }
: void testFunc(int &i) {
: // some complex operation to get x
: i = x;
: }
t*t
7 楼
why don't you do the other way, i.e. testfunc(i,j) call testfunc(i) then
calculate j.
【在 m***t 的大作中提到】
: say I have two functions:
: void testFunc(int &i, int &j) {
: //some complex operation to get both x and y
: i = x;
: j = y; //getting y is cheap if x is computed
: }
: void testFunc(int &i) {
: // some complex operation to get x
: i = x;
: }
calculate j.
【在 m***t 的大作中提到】
: say I have two functions:
: void testFunc(int &i, int &j) {
: //some complex operation to get both x and y
: i = x;
: j = y; //getting y is cheap if x is computed
: }
: void testFunc(int &i) {
: // some complex operation to get x
: i = x;
: }
m*t
9 楼
ok. testfunc actually parses a document. Parsing a document is expensive,
while checking for certain field is cheap. If parameter j is there, i need
check for j after I get the document object. If j is not there, i donot do
the checking on j field.
【在 t****t 的大作中提到】
: why don't you do the other way, i.e. testfunc(i,j) call testfunc(i) then
: calculate j.
while checking for certain field is cheap. If parameter j is there, i need
check for j after I get the document object. If j is not there, i donot do
the checking on j field.
【在 t****t 的大作中提到】
: why don't you do the other way, i.e. testfunc(i,j) call testfunc(i) then
: calculate j.
i*e
10 楼
花了300人民币不到
太便宜了!
太便宜了!
A*o
11 楼
how about this way:
void testFunc(int& i, int* j=NULL)
{
//Then test if j == NULL or not
}
by this way, you just have one interface to call
【在 m***t 的大作中提到】
: say I have two functions:
: void testFunc(int &i, int &j) {
: //some complex operation to get both x and y
: i = x;
: j = y; //getting y is cheap if x is computed
: }
: void testFunc(int &i) {
: // some complex operation to get x
: i = x;
: }
void testFunc(int& i, int* j=NULL)
{
//Then test if j == NULL or not
}
by this way, you just have one interface to call
【在 m***t 的大作中提到】
: say I have two functions:
: void testFunc(int &i, int &j) {
: //some complex operation to get both x and y
: i = x;
: j = y; //getting y is cheap if x is computed
: }
: void testFunc(int &i) {
: // some complex operation to get x
: i = x;
: }
n*r
17 楼
Kindle上装个“多看”,联小米帐号。多看可以试读,喜欢再买。
相关阅读
谁有C++公司里面written test的题目,我可以准备一下请教如何在VC6下面安装gsl?C的左移和右移是否受BigEndian和LittleEndian的影响?简单题目如何把一个char转换成一个int啊?请教C里面动态数组的赋值matlab能解决如下问题吗?HOW TO round float numbers to integer? in CC怪问题一个Technology Preview of Qt for Win CEhow to write some C/C++ program to enable dual monitor?how to login mitbbs with java code (转载)又被铐倒了,关于constructor如何在c++里面得到程序到底试用了多少内存?关于Stevens UNP的初级问题C语言程序静态库和动态库的创建及其应用请推荐一本网络编程的入门书(c/c++)请问如何写bitset or bitmap算法问题请大虾们推荐一本关于embedded real-time programming书