打开调试
站点配置[blog.config.js]
AUTHORJast Do
BIO韬光养晦,知行合一
LINKhttps://cslearn.eu.org
KEYWORDSNotion, penetrate, MUKTI
NOTION_PAGE_IDe61206346ecb4af5aefc2073ac3c4b21
NOTION_ACCESS_TOKEN-
DEBUGtrue
FACEBOOK_PAGE_TITLEnull
FACEBOOK_PAGEnull
FACEBOOK_PAGE_ID-
FACEBOOK_APP_ID-
THEMEexample
THEME_SWITCHfalse
LANGzh-CN
HOME_BANNER_IMAGE./bg_image.jpg
SINCE2021
BEI_ANKellogg & Company.
APPEARANCElight
CUSTOM_FONTtrue
CUSTOM_FONT_URLhttps://npm.elemecdn.com/lxgw-wenkai-webfont@1.6.0/style.css
CUSTOM_FONT_SANSLXGW WenKai
CUSTOM_FONT_SERIFLXGW WenKai
FONT_AWESOME_PATHhttps://cdn.bootcdn.net/ajax/libs/font-awesome/6.2.0/css/all.min.css
BACKGROUND_LIGHT#eeeeee
BACKGROUND_DARK#000000
SUB_PATH-
POST_URL_PREFIXarticle
POST_LIST_STYLEpage
POST_LIST_PREVIEWfalse
POST_PREVIEW_LINES12
POST_RECOMMEND_COUNT6
POSTS_PER_PAGE15
POSTS_SORT_BYnotion
PREVIEW_CATEGORY_COUNT16
PREVIEW_TAG_COUNT16
CONTACT_EMAILadmin@movny.com
CONTACT_WEIBO-
CONTACT_TWITTER-
CONTACT_GITHUBhttps://github.com/
CONTACT_TELEGRAM-
CONTACT_LINKEDIN-
FIREWORKStrue
WIDGET_PETfalse
WIDGET_PET_LINKhttps://cdn.jsdelivr.net/npm/live2d-widget-model-wanko@1.0.5/assets/wanko.model.json
WIDGET_PET_SWITCH_THEMEtrue
COMMENT_GISCUS_REPO-
COMMENT_GISCUS_REPO_ID-
COMMENT_GISCUS_CATEGORY_ID-
COMMENT_GISCUS_MAPPINGpathname
COMMENT_GISCUS_REACTIONS_ENABLED1
COMMENT_GISCUS_EMIT_METADATA0
COMMENT_GISCUS_INPUT_POSITIONbottom
COMMENT_GISCUS_LANGzh-CN
COMMENT_GISCUS_LOADINGlazy
COMMENT_GISCUS_CROSSORIGINanonymous
COMMENT_CUSDIS_APP_ID-
COMMENT_CUSDIS_HOSThttps://cusdis.com
COMMENT_CUSDIS_SCRIPT_SRChttps://cusdis.com/js/cusdis.es.js
COMMENT_UTTERRANCES_REPO-
COMMENT_GITALK_REPO-
COMMENT_GITALK_OWNER-
COMMENT_GITALK_ADMIN-
COMMENT_GITALK_CLIENT_ID-
COMMENT_GITALK_CLIENT_SECRET-
COMMENT_GITALK_DISTRACTION_FREE_MODEfalse
COMMENT_GITTER_ROOM-
COMMENT_DAO_VOICE_ID-
COMMENT_TIDIO_ID-
COMMENT_VALINE_APP_ID-
COMMENT_VALINE_APP_KEY-
COMMENT_VALINE_SERVER_URLS-
COMMENT_VALINE_PLACEHOLDER抢个沙发吧~
COMMENT_WALINE_SERVER_URLhttps://waline.incitere.eu.org
COMMENT_WALINE_RECENTfalse
ANALYTICS_BUSUANZI_ENABLEtrue
ANALYTICS_BAIDU_ID-
ANALYTICS_CNZZ_ID-
ANALYTICS_GOOGLE_ID-
ANALYTICS_ACKEE_TRACKER-
ANALYTICS_ACKEE_DATA_SERVER-
ANALYTICS_ACKEE_DOMAIN_ID-
SEO_GOOGLE_SITE_VERIFICATION-
ADSENSE_GOOGLE_ID-
NOTION_PROPERTY_NAME[object Object]
ENABLE_CACHEfalse
AVATAR/avatar.png
TITLENotionNext BLOG
DESCRIPTION这是一个由NotionNext生成的站点
isProdtrue
VERSION3.6.0
主题配置(config_example.js):
TEST_CONFIGTESET

空类型指针(void *)的理解

Jast Do

未定义|Feb 22, 2022|Last edited: 2022-7-1|
type
Post
status
Published
date
Feb 22, 2022
slug
understanding-of-void-pointers
summary
tags
C
category
未定义
icon
password
Property
Jul 1, 2022 06:15 AM
void 指针是空类型指针,它不指向任何类型,即 void 指针仅仅是一个地址,所以空类型指针不能进行指针运算,也不能进行间接引用(因为指针运算和间接引用都需要指针的类型信息)。
例如:
void * p; // 仅仅表示 p 存放一个地址 p++; //error:+、-运算离不开指针类型 *p=20.5; //error:访问p指向的变量空间需要变量类型信息
由于其他指针都包含有地址信息,所以将其他指针的值赋给空类型指针是合法的;反之,将空类型指针赋给其他指针则不被允许,除非进行显式转换。
例如:
int a=20; int* ptr=&a; void *p=ptr; //OK 将整型指针值赋给空类型指针 ptr=p; //error 不能将空类型指针赋给其他指针 ptr=(int*)p; //OK 显式转换