Skip to main content

Command Palette

Search for a command to run...

Big Strings

Updated
•2 min read•View as Markdown
Big Strings
#include <stdio.h>

int main()
{
    printf("%s","Dealing with multi-line paragraph strings.\n\n");

    char memories[] = "In the quaint, picturesque village nestled between rolling hills,\
where the golden sunlight filtered through the lush foliage,\
a group of people, ranging from young children with their innocent laughter\
to wise elders with their weathered faces, gathered at the picnic spot,\
sharing heartwarming stories, homemade meals, and genuine camaraderie,\
creating cherished memories that would forever remain etched in their hearts.";
    printf("%s\n",memories);

    char memories1[] = "In the quaint, picturesque village nestled between rolling hills,"
"where the golden sunlight filtered through the lush foliage,"
"a group of people, ranging from young children with their innocent laughter"
"to wise elders with their weathered faces, gathered at the picnic spot,"
"sharing heartwarming stories, homemade meals, and genuine camaraderie,"
"creating cherished memories that would forever remain etched in their hearts.";
    printf("\n Another way : \n%s\n",memories1);

    printf("\n Printing directly from inside printf :\n\n");

    printf("%s\n","In the quaint, picturesque village nestled between rolling hills,\
where the golden sunlight filtered through the lush foliage,\
a group of people, ranging from young children with their innocent laughter\
to wise elders with their weathered faces, gathered at the picnic spot,\
sharing heartwarming stories, homemade meals, and genuine camaraderie,\
creating cherished memories that would forever remain etched in their hearts.");

    printf("\n Printing directly from inside printf, another way :\n\n");

    printf("%s\n","In the quaint, picturesque village nestled between rolling hills,"
"where the golden sunlight filtered through the lush foliage,"
"a group of people, ranging from young children with their innocent laughter"
"to wise elders with their weathered faces, gathered at the picnic spot,"
"sharing heartwarming stories, homemade meals, and genuine camaraderie,"
"creating cherished memories that would forever remain etched in their hearts.");

    return 0;
}

Output:

22 views

More from this blog

P

Programming Tutorials

89 posts