Created
November 16, 2020 09:37
-
-
Save bullheadandplato/d39666ff6c4faabf53ee2490cf5a8526 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdlib.h> | |
#include<strings.h> | |
#include<stdio.h> | |
int main(){ | |
char *sRaw="02010606FFCDAB641001565"; | |
printf("All [%s]\n",sRaw); | |
char *till18=malloc(18); | |
strncpy(till18,sRaw,18); | |
printf("till18 [%s]\n",till18); | |
int lenTill18=strlen(till18); | |
char *just18=&till18[lenTill18-1]; | |
printf("just18 [%s]\n",just18); | |
char *till17=malloc(17); | |
strncpy(till17,sRaw,17); | |
printf("till17 [%s]\n",till17); | |
int lenTill17=strlen(till17); | |
char *just17=&till17[lenTill17-1]; | |
printf("just17 [%s]\n",just17); | |
return 0; | |
} |
Author
bullheadandplato
commented
Nov 16, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment