I got this piece of code: This will print all lines of the file, but as soon as I uncomment the strncpy(), the program just stops without error. S ...
I got this piece of code: This will print all lines of the file, but as soon as I uncomment the strncpy(), the program just stops without error. S ...
Output is Segmentation fault (core dumped). The line of error is line 12 but I do not understand why that would be an issue. If ret is assigned a memo ...
The problem is for LeetCode's Implement strStr. I have a working solution when I compile and execute in my computer, it works fine, but when I try to ...
i am trying to remove even occurences of a substsring, for example if i have A11B11C11 and i want to remove 11, it will remove the ones on position 0 ...
Here is the code: How does the second for loop work? Does the function return i if it detects the word, if so how? ...
I am trying to search a string from the middle from index i and get the index of the first instance found, and then change what is stored in the strin ...
Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. We will return 0 when needle is an empty stri ...
Mainly a Java/Python coder here. I am coding a tokenizer for an assignment. (I explicitly cannot use strtok().) The code below is meant to separate th ...
Output: I want it to return: but oddly it refuses to do that and I can't seem to figure out why it's doing that. edit: I realized that the si ...
I'm making a web scraper and i'm at the point where I need to parse the incoming data. Everything was going fine until I had to find all instances of ...
I am creating code that will scan the user's inputted word and compare it to that of the keyword. When scanning, it checks if the letters are in the r ...
I am trying to detect opening folder in a specific location (myPath). I am using strstr() but I see that my system is always crashed(picture) after ex ...
#include <stdio.h> #include <string.h> int main() { //read any text file char const* const fName = "database-large.txt"; FILE ...
I want to count how many this word and operator in the string but I try to use strchr and it doesn't work. I only work when I do in the loop while ...
I want to know how to count how many words are in a string. I use strstr to compare and it works but only works for one time like this and the out ...
So i made this code with the knowledge i gather in various sites, i think there is an optimazed way to do it without pushing and poping the registers ...
I'm implementing the C "strstr" function in C. This function takes 2 string in parameter and tell whether or not, the 1st string contains the second o ...
I'm trying to reproduce the behavior of the strstr() function, which tries to find a substring in a string and for that I created the following functi ...
How to find bytes in binary file. I read the binary file to a string and try to do "strstr()" It doesn't work. if I print the string in loop as %c the ...
i got the delimiter "\r\n\r\n" in the substring, and strstr is returning null Here is the code : I launch the code with this : And ptr is equal ...