![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C 语言
Henrywawo
技术让生活更简单。
展开
-
C 语言实现字符串和整数的相互转化
下面用 C 语言实现字符串和整数的相互转化一、字符串转化为整数int str_to_num(const char* s) // 字符串转化为整数{ int exp=0, n=0; const char *h = s; const char *t = NULL; for(;*h <'0' || *h >'9'; h++) // 找到第一位...原创 2018-04-11 11:13:17 · 2303 阅读 · 0 评论 -
Linux下C语言实现UDP Socket编程
该博文参考了Linux C socket 编程之UDP一文,在这里表示感谢!发送方:/* * File: udp_sender.c * Author: 离樽 * * Created on 2019年5月29日17:08:13 * * 主要实现:发送20个文本消息,然后再发送一个终止消息 */ #include <stdio.h>#include <s...原创 2019-05-30 09:13:17 · 2600 阅读 · 0 评论 -
循环建立多级目录
本文转自 C语言 mkdir 创建多级目录void mkdirs(char *muldir){ int i, len; char str[512]; strncpy(str, muldir, 512); len=strlen(str); for(i=0; i<len; i++) { if(str[i]=='/') ...转载 2019-06-03 11:05:55 · 328 阅读 · 0 评论 -
C语言生成时间戳
#include <stdio.h>#include <string.h>#include <time.h>void get_timestamp(char* timestamp){ time_t seconds = time(NULL); //The function time(NULL) returns the time since the Epo...原创 2019-06-03 11:07:53 · 5048 阅读 · 0 评论