随笔分类 - c/c++
c/c++
摘要:项目属性-> settings -> mingw c linker 1.libs search 填写lib路径 2.lib 填写文件名,不要后缀
阅读全文
摘要:#include #include int main(int argc,char **argv){ void* vp;void** vpp;int ivalue = 5;int** ipvalue;vp = &ivalue;vpp = &vp;printf("vp: [%d]\n", *( (int*)vp) ); // (int*) 是强制转换 ;*(强制转换后的var)printf("vpp: [%d]\n", *( (int *) (*vpp) ) ); // *vpp 指向 第一个*引向printf("vpp: [%d]
阅读全文
摘要:c++ WebBrowser 控件http://files.cnblogs.com/solq/TestWebBrowser.rar
阅读全文
摘要:这里归纳了C API可使用的函数,并在下一节详细介绍了它们。函数描述mysql_affected_rows()返 回上次UPDATE、DELETE或INSERT查询更改/删除/插入的行数。mysql_autocommit()切换 autocommit模式,ON/OFFmysql_change_user()更改打开连接上的用户和数据库。mysql_charset_name()返 回用于连接的默认字符集的名称。mysql_close()关闭服务器连接。mysql_commit()提 交事务。mysql_connect()连接到MySQL服务器。该函数已不再被重视,使用 mysql_real_con
阅读全文
摘要:首先安装mysql,点完全安装,才能在在安装目录include找到相应的头文件,注意,是完全安装。我装的是5.1版本,需要的头文件有把需要的文件添加进去,然后再把libmysql.lib放到项目目录里,文件在mysql安装目录lib 下面.#include "stdafx.h"#include <iostream>#include <winsock2.h>#include "mysql.h"//#pragma comment(lib, "ws2_32.lib")#pragma comment(lib,"
阅读全文
摘要:#include <stdio.h>#include <stdlib.h>#include <string.h>struct test{ char* name; int age; int qq;} date[]={ { "solq",18,33333 }, { "wei cheng",20,444444 }, { "hong",55,5555555 }};int sreach(struct test* ar,char* name);int main(int argc, char* argv[]){
阅读全文
摘要:#include <stdio.h>void qsort(int s[], int l, int r){ int i, j, x; if (l < r) { i = l; j = r; x = s[i]; while (i < j) { while(i < j && s[j] > x) j--; /* 从右向左找第一个小于x的数 */ if(i < j) s[i++] = s[j]; while(i < j && s[i] < x) i++; /* 从左向右找第一个大于x的数 */ if(i < j)
阅读全文
摘要:用PHP来书写吧 $ar=array(1,2,3,4,5,......);$n=count($ar);for($i=0;$i<$n;$i++) for($j=0;$j<$n-1;$j++) //每次循环取 最大值或者最 小值 { $next=$j+1; if($ar[$j]>$ar[$next]){ //当前元素值 大于 下一个元素值,则替换 $t=$ar[$j]; $ar[$j]=$ar[$next]; $ar[$next]=$t; } }print_r($ar);//忧化算法for($i=0;$i<$n;$i++) for($j=$n-1;$j>=$i;$j-
阅读全文
摘要:1 #include "stdafx.h" 2 #include <stdlib.h> 3 struct tree{ 4 char info; 5 struct tree* left; 6 struct tree* right; 7 }; 8 struct tree* root; 9 struct tree* construct(struct tree* root,struct tree* insert,char info);10 void print(struct tree* root,int n);11 12 int main(int argc, char*
阅读全文
摘要:#include "stdafx.h"#include <stdlib.h>int a,b,MAX;int* p;int *top,*foot;int push(int n) //压栈操作{ if(p>foot) { printf("overflow max"); return -1; } *p=n; p++; return 1;}int pop() //出栈操作{ p--; if(p<top) { printf("overflow min\n"); return -1; } return *p;}int ma
阅读全文
摘要:#include <stdlib.h>#include <stdio.h>struct test{ int value; struct test *next;};struct test* create(){ //创建create 函数,返回 struct test* 结构指针 返回的是头部指针 test *head,*tail,*p; head=tail=NULL; //head 是保存头部指针,p是当前指针,tail是临时替换的指针,是用来过度的 int i; for(int j=0;j<4;j++) { scanf("%d",&i)
阅读全文
摘要:#include <stdlib.h>#include <stdio.h>struct test{ int value; struct test *next;};struct test* create(){ //创建create 函数,返回 struct test* 结构指针 返回的是头部指针 test *head,*tail,*p; head=tail=NULL; //head 是保存头部指针,p是当前指针,tail是临时替换的指针,是用来过度的 int i; while(scanf("%d",&i)==1) { //(数据类型)mallo
阅读全文

浙公网安备 33010602011771号