- 18
- 0
- 约小于1千字
- 约 2页
- 2017-06-08 发布于重庆
- 举报
C语言关于简单的字符串移位函数voidLoopMov
?C语言关于简单的字符串移位函数void LoopMove char *pStr, int steps #include stdio.h
#include string.h
#include
void LoopMove char *pStr, int steps int str_len; int shift_len; char *tmp_str NULL; str_len strlen pStr ; shift_len str_len-steps; tmp_str char * malloc sizeof char * str_len+1 ; if tmp_str NULL return; if steps str_len return; strncpy tmp_str, pStr+steps , shift_len ; strncpy tmp_str+shift_len, pStr, steps ; * tmp_str+str_len \0; strcpy pStr, tmp_str ; free tmp_str ; int main void int i; char *str; for i 0; i 20; i++ strcpy str, hello,world! ; LoopMove str, i ; printf %s\
您可能关注的文档
最近下载
- Micromeritics ASAP2020 全自动物理和化学吸附用户手册.pdf
- 甲醇精馏塔毕业设计(优.选).docx VIP
- 2026届高考必备名著阅读之《红楼梦》复习课件.pptx VIP
- 计算机应用基础 实训项目四 PowerPoint 综合应用.ppt VIP
- 施耐德培训讲义04开关的选择性、限流和级联技术介绍教学文稿.ppt VIP
- (辐射防护与核安全)辐射防护工程试题及答案.doc VIP
- 20S515 钢筋混凝土及砖砌排水检查井.docx VIP
- 新材料专题:微玻纤无边界成长.pdf
- 七年级历史期末考试卷.docx VIP
- GB30871-2022动火作业票填写模板.docx VIP
原创力文档

文档评论(0)