0
#include <stdio.h>
#include <stdlib.h>
#include<ctype.h>
void main()
{
    char str[50];
    int i=0;
    printf("enter the string: ");
    fgets(str,sizeof(str),stdin);
    printf("the abbrevation of string is");
    printf("%c",toupper(str[i]));
    for(i=0;str[i]!='\0';i++)
    {
        if(str[i]== '')
        {
        i++;
    printf("%c",toupper(str[i]));
        }
    }

}

error at line 14
2
Contributors
2
Replies
4
Views
5 Years
Discussion Span
Last Post by rithish
0

It would help to read the error message, which mine read somewhere along the lines of empty character constant. Unlike strings(double quotes), there is no implied value(nul value, '\0') in a character literal(single quote) so it would produce an error. Fill the single quote with a space since that's what I think you intend.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.