Results 1 to 12 of 12
Hybrid View
-
2nd March 2008 19:45 #1
"" - "broy", - "ot" . Visual Studio 2005 Express edition. , Debug , Release, retval . . , , printf- .
, . , , , .
Code:#include <stdio.h> #include <string.h> char *strdel(char *s, unsigned __int16 ot, unsigned __int16 broy) { char retval[1024]; unsigned __int16 i, j; for (i=ot, j=0; i<ot+broy && i<strlen(s); i++, j++) retval[j]=s[i]; retval[j]=0; //printf("%s",retval); return retval; } void main() { char s[256], p[256]; strcpy_s(s, "Kondio qde spanak"); strcpy_s(p, strdel(s, 0, 4)); printf("s=%s\np=%s\n", s, p); }Fujistu Lifebook E756 | Core i7-6500U / 400MHz-3.1GHz | 8 GB DDR4-2133 | Samsung PM871 / 256 GB SSD | 15" 1920x1080 | Manjaro Linux + kernel 4.19
-
2nd March 2008 19:59 #2
-
3rd March 2008 11:33 #3
- strcpy_s(p, strdel(s, 0, 4)):
Code:strncpy(p, s+0, 4);
Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others
-
3rd March 2008 13:50 #4
, , ,
. - Pesho
. icaci, , . , . :Code:void strdel(char *vhod, char *izhod, unsigned __int32 ot, unsigned __int32 broy) { char retval[1024]; unsigned __int32 i, j; for (i=ot, j=0; i<ot+broy && i<strlen(vhod); i++, j++) retval[j]=vhod[i]; retval[j++]=0; while (j--) izhod[j]=retval[j]; }Fujistu Lifebook E756 | Core i7-6500U / 400MHz-3.1GHz | 8 GB DDR4-2133 | Samsung PM871 / 256 GB SSD | 15" 1920x1080 | Manjaro Linux + kernel 4.19
-
5th March 2008 23:37 #5
-
7th March 2008 20:25 #6
. , - "" , .
Fujistu Lifebook E756 | Core i7-6500U / 400MHz-3.1GHz | 8 GB DDR4-2133 | Samsung PM871 / 256 GB SSD | 15" 1920x1080 | Manjaro Linux + kernel 4.19
-
3rd March 2008 15:02 #7Registered User
Join Date: Oct:2003
Location:
Posts: 4,317
, ? strncpy(), icaci?
, , embedded . Visual Studio, .
-
4th March 2008 04:35 #8Registered User
Join Date: Jul:2006
Location:
Posts: 480
bsb, ,
. .
4eRNoBiL, retval. => , . , , , strlen, , , . "" " ." " ." , .
:
0<=I<LENGTH(S), D . , n .Code:void COPY(char* D,char* S,int I,int N) { S+=I; while(N-- && *S) *D++=*S++; *D=0; }
-
7th March 2008 22:29 #9
djb. , ...
Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others
-
10th March 2008 12:00 #10
djb?
This isn't right. It's not even wrong. -- Wolfgang Pauli
-
10th March 2008 13:14 #11
... djb djb.
Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others
-
10th March 2008 14:45 #12
10x
This isn't right. It's not even wrong. -- Wolfgang Pauli




Reply With Quote

Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in