#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

Recommended Answers

All 2 Replies

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.

ok thanks dude iam known to it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.