Title Description: Given a string
Requires writing a function that implements the following functions
Function 1: Bar even digit characters are picked out to form a string
Feature 2: bar odd digit characters are picked out to form a string
Stores a string in different strings by odd and even digits # define _crt_secure_no_warnings#include <stdlib.h> #include <string.h># Include<stdio.h>int getstr1str2 (char * source, Char *buf1, char *buf2) {char *p = Source;int num = 0; Record function return value if (Source = = NULL | | buf1 = = NULL | | buf2 = = NULL)//Determine if NULL pointer {num = -1;printf ("func getstr1str2 () Err (source = = NULL | | BUF1 = = NULL | | Buf2 = = NULL):%d ", num); return num;} int i = 9;int j = 0;int m = 0;for (m=0,i = 0, j = 1; I < strlen (source) && J < strlen (source); m++) {Buf1[m] = Source[i];buf2[m] = Source[j];i = i + 2;j = j + 2;} Buf1[m] = ' n '; buf2[m] = ' + ';} void Main () {char *str_old = "1a2b3d4c"; char Str_new1[100];char str_new2[100];getstr1str2 (Str_old, Str_new1, STR_NEW2); printf ("str_old:%s \ n", Str_old);p rintf ("str_new1:%s \ n", Str_new1);p rintf ("str_new2:%s \ n", str_new2); System ("Pause "); return;}
Place a string in separate strings by odd and even digits