📄 memex.c
字号:
/* * file: memex.c */#include <stdio.h>#include "cdecl.h"#define STR_SIZE 30/* * prototypes */void PRE_CDECL asm_copy( void *, const void *, unsigned ) POST_CDECL;void * PRE_CDECL asm_find( const void *, char target, unsigned ) POST_CDECL;unsigned PRE_CDECL asm_strlen( const char * ) POST_CDECL;void PRE_CDECL asm_strcpy( char *, const char * ) POST_CDECL;int main(){ char st1[STR_SIZE] = "test string"; char st2[STR_SIZE]; char * st; char ch; asm_copy(st2, st1, STR_SIZE); /* copy all 30 chars of string */ printf("%s\n", st2); printf("Enter a char: "); /* look for byte in string */ scanf("%c%*[^\n]", &ch); st = asm_find(st2, ch, STR_SIZE); if ( st ) printf("Found it: %s\n", st); else printf("Not found\n"); st1[0] = 0; printf("Enter string:"); scanf("%s", st1); printf("len = %u\n", asm_strlen(st1)); asm_strcpy( st2, st1); /* copy meaningful data in string */ printf("%s\n", st2 ); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -