strcpy() destination is not enough
char *array1 = "Happy Birthday to You"; char array3[1]; strcpy(array3,array1); cout<
vetor list 区别
vector和数组类似,它拥有一段连续的内存空间,并且起始地址不变,因此它能非常好的支持随机存取(即使用[]操作符访问其中的元素),但由于它的内存空间是连续的,所以在中间进行插入和删除会造成内存块的拷贝(复杂度是O(n)),另外,当该数组后的内存空间不够时,需要重新申请一块足够大的内存并进行内存的拷贝。这些都大大影响了vector的效率。 list是由数据结构中的双向链表实现的,因此它的内存空间可以是不连续的。因此只能通过指针来进行数据的访问,这个特点使得它的随机存取变的非常没有效率,需要遍历中间的元素,搜索复杂度O(n),因此它没有提供[]操作符的重载。但由于链表的特点,它可以以很好的效率支持任意地方的删除和插入。...
Installation Cassandra on Win7
version : Cassandra-1.2.4 1. Download Cassandra binary files from here: http://cassandra.apache.org/download/ 2. Extract Cassandra source files. e.g. to D:\cassandra 3. Set environment variables. (Go to System Properties -> Tab Advanced -> button Environment...
java array
在java类中,添加一个数组作为成员,以及如何实例化这个类。并把几个实例化的对象存在一个数组内。 public class Hotel { private String hotelId; private String hotelName; private int numberRooms; private int[] numberRest = new int[364]; public Hotel(){}; public Hotel(String hotelId, String hotelName,...
Basic knowledge C/C++ (2)
Difference between C++ and java Java runs in a virtual machine C++ supports unsigned arithmetic C++ allows operator overriding C++ àmultiple inheritance of class Java has a build-in garbage collection In java, parameters are always passed by value C++...
WS client Eclipse + Tomcat
refer : http://www-inf.it-sudparis.eu/~nguyen_n/teaching_assistant/web_services/webservice_client_generation WS Client deployment with Eclipse WTP In this tutorial we will see how Eclipse generate the Client stub. We start with the HelloWorld service...
HelloWorld service deployment. Eclipse and Tomcat
refer : http://www-inf.it-sudparis.eu/~nguyen_n/teaching_assistant/web_services/simple_web_service_deployment_with_eclipse_and_tomcat_server Setting up Tomcat on Eclipse Download and extract Tomcat (suppose version 7.0.12) on your machine. Open the server...
Basic knowledge C/C++ (1)
1. storage qualifiers Volatile : keyword for variables, the value will change every time we use it, we should read the value in the memory. const: cannot be changed 2.static: 2.1 for variable: it means the value cannot be changed when the function/method...
windows下配置Tomcat7.0
一、安装JDK 1.7 1、添加环境变量:在 我的电脑->属性->高级->环境变量 2、新建系统变量,变量名:JAVA_HOME 变量值:C:\Program Files\Java\jdk1.7.0 (JDK的安装目录) 3、在原有的系统变量 Path后面加上英文分号,再添加%JAVA_HOME%\bin;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\jre\bin; 不要删除原来的。看清楚,它们之间的分号,是英文的分号。 4、重启电脑生效(因为添加的是系统变量,如果你的系统是win7,则不需要重启)。...
数组总结 c++
char a [5];分别是a[0],a[1],a[2],a[3],a[4]。 char name[]=”Ray Krebbs”; char name[11]=”Ray Krebbs”;系统将自动在字符串末尾添上结束标志’\0’。 数组初始化时,用作初始化的数组元素值放在一个大括号{}中,例如: int a[3]={ 1, 1, l }; //含三个元素的整型数组,元素的值都是1。 int b[5]={1, 2, 3 }; //可以只给部分(本例为前3个元素)赋值。 int a[]={1, 1,...