How to declare a string with double quote substrings in C

1 Answer

0 votes
#include <stdio.h>

int main() {
    // Declare a string with double quotes
    char str[] = "This is a string with \"double-quoted substring1\", and \"double-quoted substring2\" inside.";
    
    printf("%s\n", str);

    return 0;
}

  
  
/*
run:
  
This is a string with "double-quoted substring1", and "double-quoted substring2" inside.
  
*/

 



answered May 12, 2025 by avibootz
...