文章列表
 
您正在查看 "c++" 分类下的文章

2012-05-27 9:24

#include<iostream>

#include<stdarg.h>

 

constint N=5;

usingnamespace std;

 

 
2011-03-30 21:35
Monday, July 14, 2008 10:03 AM rismanaNumerical Recipes Tutorial - Part 1

I was struggled to use NR almost 12 years ago with C and FORTRAN compilers. We didn't have internet at that time and very limited information. I used to read all the codes from the book, re-wrote it, compiled and modified to match my requirements. It was not easy at all! By

 
2010-07-01 19:10
原因: 程序中有的地方需要计算  tan(x),   x 接近 pi/2 

 
2010-06-24 8:35
Stack Overflow Problems   http://cs.nyu.edu/exact/core/doc/stackOverflow.txt
=======================
This file gives some hints on addressing this problem on different platforms.

Under Unix-like systems, programs may throw a "Segmentation Fault"
error. This can be due to stack overflow, especially from recursive
function calls or huge data sets. In our demo program "Pi"
(see "$(CORE_PATH)/progs/pi"), we compute Pi to any number
 
2010-06-21 13:41
程序在运行过程中多次输出数据到文件中。

程序需要读入一个整数,然后运行。当读入整数是3的时候,
程序出错了, 出错处在了写文件的语句上, 具体说来是给输出文件取名字的语句上。

sprintf(filename, "current%d", nt)
有了这些语句,程序就要出错,而且不是第一次运行到这儿出错,而是第三次运行到这儿出错。
我使用
ostringstream  来代替 sprintf, 还是不行。

真是非常的奇怪的事情, 程序中有多处 sprintf 的语句,其他的没有问题。 就是这句话折腾了我大半天
 
2010-06-21 13:31
原帖地址 : http://www.programfan.com/blog/article.asp?id=12763

在将各种类型的数据构造成字符串时,sprintf 的强大功能很少会让你失望。由于sprintf printf 在用法上几乎一样, 只是打印的目的地不同而已,前者打印到字符串中,后者则直接在命令行上输出。这也导致sprintf printf 有用得多。

sprintf 是个

 
2010-01-05 14:23
yaowenqi@yaowenqi-laptop:~/桌面/aztecoo$ ./a1
/tmp/ccFa0D5s.o: In function `__static_initialization_and_destruction_0(int, int)':
ex1.cpp:(.text+0x36): undefined reference to `std::ios_base::Init::Init()'
ex1.cpp:(.text+0x3b): undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccFa0D5s.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld 返回 1

解决方法:
加   -lstdc++
这是configure 的一个错误。 加 -lstdc++ 是一
 
2009-08-04 20:19
/*
* ============================
*
*       Filename: binaryio.cpp
*
*    Description: 二进制读写
*
*        Version: 1.0
*        Created: 2009年08月04日 19时40分25秒 CST
*       Revision: none
*       Compiler: gcc
*
*      
 
2009-08-01 20:26
标签: debug c c++ 调试 CPU 时间 子程序 , profiling

写程序要提高程序的效能,就要找出计算量最大的部分,认真的研究这部分程序,
提高这部分效率。GNU的开发工具 gprof 是一个, 编译联接的时候要使用 -pg .

Qprof 是另一个工具, 简单一些只要加上 -g 参考即可。

使用方式如下:
tlu:~$ cat test.cpp
/*
* =============================
*
*       Filename: test.cpp
*
*    Description:
*
*
 
2009-07-20 10:25
body class="mediawiki ltr ns-0 ns-subject page-How_to_compare_double_or_float_in_Cpp skin-monobook">

How to compare double or float in Cpp

From MetaSharp

Jump to: navigation, search

Article Author(s): Audric Thevenet
All Rights Rese

 
   
 
 
文章存档
 
     
 
最新文章评论
  

这样做是不是只能转化为utf8不能搞成gbk啊? 好像用iconv可以任意转换
 

求问:如何向vector中的指定位置中插入数据???
 

最近在用,学习了
 

学习了
 

//并行输出往往次序是混乱的,为了按顺序输出,我们采用下面这段代码 //输出代码将会
   
帮助中心 | 空间客服 | 投诉中心 | 空间协议
©2012 Baidu