¸øÄãµÄC³ÌÐò¼ÓÉÏÑÕÉ«
±ê×¼C¿ØÖÆ̨³ÌÐòÒ²¿ÉÒÔ×Ô¶¨ÒåÎÄ×ÖÊä³öÑÕÉ«£¬ÈôòÓ¡ÐÅÏ¢¸üÏÊÃ÷£¬ÔÚdebugµÄʱºòÌرðÓÐÓ᣷½·¨ºÜ¼òµ¥£º
ת×Ô£ºhttp://www.diybl.com/course/3_program/c/c_js/20090303/157456.html
ÏÈ´ÓÒ»¸öÀý×Ó¿ªÊ¼
printf("\033[31m ####----->> \033[32m" "hello\n" "\033[m");
ÑÕÉ«·ÖΪ±³¾°É«ºÍ×ÖÌåÉ«£¬30~39ÓÃÀ´ÉèÖÃ×ÖÌåÉ«£¬40~49ÉèÖñ³¾°£¬ÈçÏ£º
±³¾°É« ×ÖÌåÉ«
40: ºÚ 30: ºÚ
41: ºì 31: ºì
42: ÂÌ 32: ÂÌ
43: Ȯ 33: Ȯ
44: ˦ 34: ˦
45: ×Ï 35: ×Ï
46: ÉîÂÌ 36: ÉîÂÌ
47: °×É« 37: °×É«
ÁíÍ⣺¼ÇµÃÔÚ´òÓ¡ÍêÖ®ºó£¬°ÑÑÕÉ«»Ö¸´³ÉNONE£¬²»È»ÔÙºóÃæµÄ´òÓ¡¶¼»á¸ú×űäÉ«¡£
»¹¿ÉÒÔ¼ÓһЩANSI¿ØÖÆÂë¡£¼ÓÑÕÉ«Ö»ÊÇÒÔÏ¿ØÖÆÂëÖеÄÒ»ÖÖ£º
\033[0m ¹Ø±ÕËùÓÐÊôÐÔ
\033[1m ÉèÖøßÁÁ¶È
\033[4m Ï»®Ïß
\033[5m ÉÁ˸
\033[7m ·´ÏÔ
\033[8m ÏûÒþ
\033[30m -- \033[37m ÉèÖÃÇ°¾°É«
\033[40m -- \033[47m ÉèÖñ³¾°É«
\033[nA ¹â±êÉÏÒÆnÐÐ
\033[nB ¹â±êÏÂÒÆnÐÐ
\033[nC ¹â±êÓÒÒÆnÐÐ
\033[nD ¹â±ê×óÒÆnÐÐ
\033[y;xH ÉèÖùâ±êλÖÃ
\033[2J ÇåÆÁ
\033[K Çå³ý´Ó¹â±êµ½ÐÐβµÄÄÚÈÝ
\033[s ±£´æ¹â±êλÖÃ
\033[u »Ö¸´¹â±êλÖÃ
\033[?25l Òþ²Ø¹â±ê
\033[?25h ÏÔʾ¹â±ê
Ïà¹ØÎĵµ£º
1£®ÒÑÖªstrcpy º¯ÊýµÄÔÐÍÊÇ£º
char *strcpy(char *strDest, const char *strSrc);
ÆäÖÐstrDest ÊÇÄ¿µÄ×Ö·û´®£¬strSrc ÊÇÔ´×Ö·û´®¡£²»µ÷ÓÃC++/C µÄ×Ö·û´®¿âº¯Êý£¬Çë±àдº¯Êý strcpy
´ð°¸£º
char *strcpy(char *strDest, const char *strSrc)
{
if ( strDest == NULL || strSrc == NULL)
return NULL ;
if ( strDest ......
C³ÌÐòÖоßÓзḻµÄÊý¾ÝÀàÐÍ£¬°üÀ¨ÉùÃ÷ÖÐÏÔʽ¶¨ÒåµÄÀàÐͺÍÓÃ×ö±í´ïʽÖмäÀàÐ͵ĵ¼³öÀàÐÍ¡£ÀýÈ磬ÏÂÃæµÄ¸³ÖµÓï¾ä°üº¬3 ÖÖ²»Í¬ÀàÐÍ:
int *p, x;
*p = x;
xÊÇÒ»¸ö´æ·ÅÕûÊýµÄµ¥ÔªµÄµØÖ·£¬Òò´ËxµÄµØÖ·µÄÀàÐÍÊÇ£ºÖ¸ÏòÒ»¸öÕûÊýµÄÖ¸Õë¡£xµÄÖµµÄÀàÐÍÊÇÕûÐÍ¡£Í¬Ñù, pµÄ×óÖµµÄÀàÐÍÊÇÖ¸ÏòÒ»¸öÕ ......
ʹÓÃC/C++À©Õ¹Python
·Òë:
gashero
Èç¹ûÄã»áÓÃC£¬ÊµÏÖPythonǶÈëÄ£¿éºÜ¼òµ¥¡£ÀûÓÃÀ©Õ¹Ä£¿é¿É×öºÜ¶àPython²»·½±ã×öµÄÊÂÇ飬ËûÃÇ¿ÉÒÔÖ±½Óµ÷ÓÃC¿âºÍϵͳµ÷Óá£
ΪÁËÖ§³ÖÀ©Õ¹£¬Python API¶¨ÒåÁËһϵÁк¯Êý¡¢ºêºÍ±äÁ¿£¬ÌṩÁ˶ÔPythonÔËÐÐʱϵͳµÄ·ÃÎÊÖ§³Ö¡£PythonµÄC APIÓÉCÔ´Âë×é³É£¬²¢°üº¬ “Python.h” Í·Îļ ......
¡¾checkpass.c¡¿
#include <stdio.h>
#include <string.h>
int checkpass(void){
int x;
char a[9];
x = 0;
fprintf(stderr,"a at %p and\nx at %p\n", (void *)a, (void *)&x);
printf("Enter a short word: ");
&nbs ......