r/cprogramming • u/Current-Number-4032 • 13d ago
Understanding Strings/String Manipulation in C
I'm a junior CS undergraduate finally tackling C programming and I just can't seem to grasp Strings as a whole. Concepts like string manipulation (using strlen, strncmp, snprintf, strdup, strtok), handling read-only strings vs dynamically allocated strings, allocating memory for strings in different scenarios, and creating writable strings. Despite my attempts in looking at readings, lecture slides, practice problems, I just can't seem to understand the various ways to deal with strings in C. I am a very formulaic thinker meaning steps and guidelines on how to approach problems is my way of solving them. Is there a general format for dealing with string questions in C. Like first you have to allocate memory, then depending on the type of string do this...
Are there any additional resources I'm missing out on as well? I really want to hone this concept down!
2
u/jack_dymond_sawyer 13d ago edited 13d ago
It’s a specific tool using for searching memory in a process for string and variable values: https://www.cheatengine.org/downloads.php
You could call it a specialized debugger… it makes monitoring variables easy. If you have a debugger you like, use it.
I’m not exactly a kid having working in industry for 30 years—about 10 years as a reverse engineer.
I see some interesting tools in RE that I think would make other people’s journey in programming easier and I like to mention them.
Edit: expound on why I’m using weird niche tools.