Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- void inputParsing(char *src, char *end, char *destU, char *destP) {
- int x = 0;
- for(; src != end; src++){
- if((*src != '+') && x==0) {
- *destU = *src;
- destU++;
- }
- else if((*src != '+') && x==1){
- *destP = *src;
- destP++;
- }
- else {
- x = 1;
- }
- }
- *destU = ' '; //What does this line do?
- *destP = ' '; //What does this line do?
- *++destU = '0'; //What does this line do?
- *++destP = '0'; //What does this line do?
- printf("%sn",&destU);
- printf("%sn",&destP);
- }
- void inputStoring() {
- char inputArray[200];
- char usernameArray[200];
- char passwordArray[200];
- //int n = atoi(getenv("CONTENT_LENGTH"));
- //fgets(inputArray, n+1, stdin);
- strcpy(inputArray, "gaming+koko");
- int n = strlen(inputArray);
- inputParsing(inputArray, inputArray + n, usernameArray, passwordArray); //inputArray+n is referencing the array cell that contains the last inputted character.
- }
- int main(void) {
- inputStoring();
- }
- *++destU = '