2

My code

#include <stdio.h>
#include <string.h>
#include <cs50.h>

int main(int argc, string argv[]) {
    string word = "HiMyNaMeIsJames";
    strlwr(word);
    printf("%s", word);
}

It's returning that the "implicit declaration of function 'strlwr' is invalid in C99". I believe the function of strlwr should be contained within the string.h library though..

Any help would be much appreciated :D

1
  • I don't think there's such function as strlwr in string.h.
    – kzidane
    Feb 10, 2015 at 7:57

3 Answers 3

1

The function strlwr() is a function from the Microsoft c library and does not work in the standard c library. You should use the standard tolower() function.

0

Look at /usr/include/string.h and you will see that no such function is defined.

Sorry.

0

While it doesn't do exactly the same thing, you could try tolower() declared in <ctype.h>. You'd have to iterate over each character of the string though; you couldn't just call it once to turn all letters to lowercase. Hope this helps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .