Skip to main content
3 votes
3 answers
202 views

I am building a c extension for a python module and it needs to work the same on a windows machine and on a raspberry pi. #include <stdio.h> #include <string.h> #include <ctype.h> #...
KarlTheKrazyKat's user avatar
3 votes
5 answers
265 views

I'm trying to reimplement the standard strlen function in C, and I'm closely replicating its behavior. I defined my function based on standard C declaration for strlen: size_t ft_strlen(const char *s);...
user31651582's user avatar
0 votes
2 answers
156 views

The code is supposed to reverse the words that have the length equal to longest word length from the phrase. Input string: #Voi#da#bacu#la#info# Expected output string: #Voi#da#ucab#la#ofni# I ...
Mihai's user avatar
  • 9
1 vote
4 answers
192 views

Consider this example where I add some extra \0 to a string. #include <stdio.h> #include <string.h> int main(int argc, char **argv){ char str1[] = "dog"; char str2[] = &...
Labeeb's user avatar
  • 117
0 votes
2 answers
116 views

I'm working on a C program, which takes an input in form of a parameter and then needs the length of the string to continue its work. Unfortunately I'm facing a massive issue in form of a wrong ...
GoldNova's user avatar
  • 373
1 vote
2 answers
75 views

basically I'm trying to get the length (using strlen) of an argument, but i keep getting this error. From what I've understood it means that I'm giving an array of pointers to char arrays instead of a ...
Jack's user avatar
  • 33
2 votes
3 answers
217 views

Just so I can confirm if what I think is going on is really going on. The following code prints out 25 when I give it the (26 letter) alphabet as an input, is it because fgets always automatically ...
Guilherme Cintra's user avatar
2 votes
1 answer
164 views

I have two functions that convert a string to lowercase. The first one calls strlen() in every iteration, while the second one only calls it after modifying the string. I expected the compiler to ...
Andy Lee's user avatar
2 votes
3 answers
247 views

I'm new to programming, so I was practicing with C. Then I ran to a problem with my code: #include <stdio.h> #include <string.h> int main() { char a[] = "Hello"; printf(&...
hasaanE's user avatar
  • 23
0 votes
1 answer
91 views

I am trying to write a little program, which is resistant against buffer overflow and similar vulnerabilities. Since we cannot trust the user input, I thought it would be a good idea to concatenate ...
Sir Muffington's user avatar
4 votes
0 answers
103 views

In OPENJDK's StringSupport class, there are following codes checking if there could be a '\0' byte in a long value: private static final long HIMAGIC_FOR_BYTES = 0x8080_8080_8080_8080L; private static ...
benrush's user avatar
  • 373
3 votes
1 answer
194 views

I have a program that accepts non-english characters also as an input field. Because we use strlen, it has failed to give expected length while calculating the length of the string when there is a non-...
Bover's user avatar
  • 39
0 votes
0 answers
108 views

I have a wordpress site, and my registration url is Registration URL. I have registered a hook to modify user_login after registration if username is more than 10 digits. if user given mobile number ...
PRATAP KUMAR KOTTI's user avatar
1 vote
1 answer
112 views

I have been trying to find a solution for my school project. The program should display an invalid error if the user enters "Y Y". Currently the program still accepts it and moves on to the ...
notblinkz's user avatar
0 votes
1 answer
177 views

This code is from a problem in HackerRank (Q: Printing Tokens in C). #include <stdio.h> #include <string.h> #include <stdlib.h> int main() { char *s = malloc(1024 * sizeof(char))...
Prabash's user avatar
  • 15

15 30 50 per page
1
2 3 4 5
48