C
孤舟听雨
这个作者很懒,什么都没留下…
展开
-
C的结构体和C++结构体的区别
1.C的结构体和C++结构体的区别 1.1 C的结构体内不允许有函数存在,C++允许有内部成员函数,且允许该函数是虚函数。所以C的结构体是没有构造函数、析构函数、和this指针的。 1.2 C的结构体对内部成员变量的访问权限只能是public,而C++允许public,protected,private三种。 1.3 C语言的结构体是不可以继承的,C++的结构体转载 2014-11-15 16:41:02 · 1197 阅读 · 0 评论 -
Visual Studio 2013: fatal error C1083: Cannot open include file: 'winsock2.h': No such file or direc
I migrated some "native" c++ projects from Visual Studio 2010 on Windows 7 to Visual Studio 2013 on Windows 8.1. Rebuilding gave me this error. I realized I did not have the Windows SDK installed, s翻译 2015-03-20 17:35:52 · 3434 阅读 · 0 评论 -
去除相同的字符
define _CRT_SECURE_NO_WARNINGSinclude “string.h”include “stdio.h”include”malloc.h”define NUM 256char * squeeze(char s1[], char s2[]){ int asc[256] = { 0 }; char* stmp = (char*)malloc(strlen原创 2016-11-08 17:49:43 · 367 阅读 · 0 评论 -
centos7 安装C帮助文档
[root@lixixi ~]# yum install man-pages [root@lixixi ~]# man 3 printf原创 2017-05-17 17:28:57 · 1005 阅读 · 0 评论 -
有序链表合并
有序链表合并#include <stdio.h>#include <stdlib.h>typedef struct PNode { int data; struct PNode *next;} LNode_t;void orderInsert(LNode_t **head, LNode_t **tail, int data) { L...原创 2019-08-25 22:00:40 · 180 阅读 · 0 评论 -
输入一行字符串(单词和若干空格), 输出该行单词个数。
/*输入一行字符串(单词和若干空格), 输出该行单词个数。Input:____hello_________world_ how___are___you___\nOutput: 5*/#include <stdio.h>#include <stdlib.h>int main() { char str[50] = {0}; int cou...原创 2019-08-26 14:19:40 · 1193 阅读 · 0 评论 -
输入一行字符串,把字符串翻转
输入一行字符串,把字符串翻转/*输入一行字符串,把字符串翻转 。Input: I____am__a__studentOutput: student__a__am____I(1)直接翻转一下(2)把每个单词找出来,原地自身翻转*/#include <stdio.h>#include <stdlib.h>#include "string.h"void ...原创 2019-08-26 15:36:39 · 1001 阅读 · 1 评论 -
二叉树的遍历:先序中序后序遍历的递归与非递归实现及层序遍历
摘自: https://www.cnblogs.com/llhthinker/p/4747962.html二叉树的遍历:先序中序后序遍历的递归与非递归实现及层序遍历 对于一种数据结构而言,遍历是常见操作。二叉树是一种基本的数据结构,是一种每个节点的儿子数目都不多于2的树。二叉树的节点声明如下:复制代码1 typedef struct TreeNode *PtrToNode;2 type...转载 2019-08-27 10:13:09 · 320 阅读 · 0 评论