¡¾ÇóÖú¡¿gdbµ÷ÊÔµÄÎÊÌâ
ÓÃgdbµ÷ÊÔ³ÌÐòÈçÏÂ5`^r;|'YG-]v#include <stdio.h>ME'Tv&X;@
void my_print (char *string)
{
printf ("The string is %s\n", string);
}
void my_print2 (char *string)
{
char *string2;q,y%MP+L_
int size, i;
size = strlen (string);
string2 = (char *) malloc (size + 1);
for (i = 0; i < size; i++)q'`"W B`wG!t
string2[size - i] = string[i];
string2[size+1] = '\0';
printf ("The string printed backward is %s\n", string2);
})aU0l0B5?/s
main () e?HWU^I^w
{M"W*V;_ {8l
char my_string[] = "hello there";
my_print (my_string);
my_print2 (my_string);
}
ÔÚstring2[size - i] = string[i];ÕâÐÐÓÃbreakÉè¶Ïµã
ÓÃwatch¹Û²ì±äÁ¿string2£Ûsize£i£Ý:oP\k6i
ÔÙÊäÈënextºó°´»Ø³µ£¬È´ÏÔʾ
(gdb) next$t2l[L;f\
warning: Could not remove hardware watchpoint 2.
Warning:
Could not insert hardware watchpoint 2.VVt!|+Z1j!Q
Could not insert hardware breakpoints:6D.WW `1@6z
You may have requested too many hardware breakpoints/watchpoints.C/{l5omB
ÇëÎʸ÷룬ÄÄÀï³ö´íÁË ²Ù×÷ÎÊÌ⣿û¼û¹ýÕâÖÖ´í£¬ÖØÐµ÷ÊÔÄØ£¿ #include <stdio.h>
8LP1Q$o*iB'i
char *string;
void my_print (char *string)qbL C5CS6^
{gqL/M"U)G'J&a
printf ("The string is %s\n", string);;u:VN]D2a
}
void my_print2 (char *string)
{#\n u+K7fnSG:K.us3b]`
int size, i;
size = strlen (string);Yd @0z@R)lO;c$K
string = (char *) malloc (size + 1);
for (i = 0; i < size; i++)n(Iq/M1CA
string[size - i] = string[i];
string[size+1] = '\0';
printf ("The string printed backward is %s\n", string);odR.} B;N|
}(o/XvW2d
main () Dd _x _ n4ZX
{
char my_string[] = "hello there";z_c[DA
my_print (my_string);
my_print2 (my_string);
};v!jn.zq]
Z)jz1A"vM#k2^8B?nEF
ÎÒÕâÑù¸ÄÁË£¬Êä³öÊÇ£º
The string is hello there
The string printed backward is
Ò³:
[1]