python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Include spaces when counting the length of a string
Im trying to create a simple program that reads strings entered by the user and displays the longest and shortest string. The program works fine for single words such as 'dog' or 'cat' but if I was to...
Maisie Brooke
Votes: 0
Answers: 1
Comparison of string lengths in C using strlen
I am quite confused with the behavior of strlen,the for loop below never ends (without adding the break) when try it, while the i < -2 should return False in the first step.
Is it related to my com...
Luke
Votes: 0
Answers: 2
Strlen, Malloc and address arithmetic
Need some help breaking down this C function. I'm stuck on the malloc line. I do not understand what the "+8" is doing and/or why it is even there. My research revealed it has something to d...
N6DYN
Votes: 0
Answers: 7