c语言—指针基础(4:字符串常见定义方式)
来源:互联网 发布:淘宝滞销率怎么算 编辑:程序博客网 时间:2024/06/05 08:04
字符串常见定义方式: char * = "hello";
#include "stdafx.h"int main() {char str[] = { 'a','b','c','d','\0' };char *p = str;char *q = &str[0];printf("p:%#x\n",p); //%#x 打印十六进制地址printf("p:%s\n", p); //%s 打印字符串printf("q:%#x\n", q); printf("q:%s\n", q); printf("str:%#x\n",str);printf("str:%s\n", str);//可以定义char *m = "hello";char sb[] = "hello";char *m = &sb[0];m = sb;return 0;}
阅读全文
0 0
- c语言—指针基础(4:字符串常见定义方式)
- C语言指针定义变量方式
- C语言指针定义变量方式
- C语言字符串二种方式定义
- C语言基础:C语言指针(6) - 指针和字符串
- 黑马程序员——ios基础---C语言:字符串、指针
- c语言基础2—数组、字符串、指针
- C语言基础之数组、字符串、指针
- C语言基础-指针与字符串19
- C语言基础 9 指针 字符串
- c语言指针定义
- C语言—字符串、指针
- C语言指针基础(4)
- C语言字符串定义
- C语言字符串定义
- C语言中字符串的几种定义方式
- C语言:定义字符串的几种方式
- C语言字符串指针
- c语言—指针基础(1:指针的基本概念)
- C语言—指针基础(2:指针交换两个数)
- AI的伦理与道德
- sizeof(...)运算符strlen(...)函数的区别与练习
- c语言—指针基础(3:指针和数组的关系)
- c语言—指针基础(4:字符串常见定义方式)
- Linux date命令
- c语言—指针基础(5:野指针)
- KMP透彻理解
- c语言—指针基础(6:多级指针)
- Codeforces Round #450 (Div. 2) A题 + B题
- HDU 4777 Rabbit Kingdom(树状数组+离线预处理)
- c# 遍历字典改key
- 整合SpringMvc和mybatis问题:后台已传值到jsp,但显示不出来