Skip to main content

Command Palette

Search for a command to run...

Day 94/100 100 Days of Code

Jumping Ball

Updated
1 min read
Day 94/100 100 Days of Code
C

AKA Chris, is a software developer from Athens, Greece. He started programming with basic when he was very young. He lost interest in programming during school years but after an unsuccessful career in audio, he decided focus on what he really loves which is technology.

He loves working with older languages like C and wants to start programming electronics and microcontrollers because he wants to get into embedded systems programming.

More string issues. I made many changes to fix the problem where the variables holding the paths were getting altered. I tried using a mix of calloc, memory addresses of char**, and const, but the result was the same. I still don't know how to fix it.

For the results, I created a for loop to read the values from the CSV file that the mini application outputs. It seems to work well. I might need to add a switch here to assign the correct values to the Results struct. The loop has not been completed yet because I spent most of the session figuring out errors.

for (int i = 0; i < 3; i++)
{
    char *characterLoc = strchr(tempCopy, ',');
    size_t index  = (size_t)(characterLoc - tempCopy);
    char *result = calloc(index, sizeof(char));
    strncpy(result, tempCopy, index);
    printf("Result: %s\n", result);
    free(result);
    char *toCopy = calloc(strlen(tempCopy) - index, sizeof(char));
    strncpy(toCopy, tempCopy + index + 1, strlen(tempCopy )- index);
    printf("Copy: %s\n", toCopy);
    tempCopy = toCopy;
}

I guess more experimentation is needed.

100 Days of Code

Part 1 of 50

100 days of code is a good initiative to go into hard mode and spend more time in programming. These 100 days will be focused on completing projects and research.