Programming
Python
R
Java
C
C++
C#
WEB
HTML
CSS
JavaScript
BootStrap4
jQuery
SVG
MORE
Examples1
Python
GO
R
Java
C
C++
C#
Examples2
Python
R
Java
C
C++
C#
HTML
CSS
JavaScript
BootStrap4
jQuery
SVG
Seo Tools
Code Minifier
Code Beautifier
Language Compiler
Misc Tools
File Converter
References
C
C++
Python
Java
PHP
JavaScript
Examples
Python
R
Java
C
C++
C#
HTML
CSS
JavaScript
BootStrap4
jQuery
SVG
Home
About
Contact
JetPack
Multi Themes-->>
Code it ALL
Scroll TOP
Character Array in C - CodeGK
Δ C Examples
Hello_world
"Hello World" program in C
Break
Break out of For Loop in C
Break out of While Loop in C
Strings
String Declaration in C ?
String Initialization in C ?
strlen() in C
strcpy() in C
strcat() in C
strcmp() in C
For_loop
Number Loop in C
Iterate Through String in C
Variables
Global Variable in C
Local Variable in C
Booleans
C Booleans
Arrays
Character Array in C
Integer Array in C
While_loop
While Loop in C
Recursive_function
Factorial with C Function Recursion
Sum of Natural Numbers with C function Recursion
Function
add Two numbers in C
Calculating factorial of number using Recursion in C
Print
puts() in C
printf() in C
printf() for printing various types of Data Types
Continue
Continue in For Loop in C
Continue in While Loop in C
If_else
IF in C
ELSE in C
Else-If in C
Numbers
Integers in C
Float in C
Double in C
Syntax
Right Syntax in C
Wrong Syntax in C
Operators
Comparison Operators in C
Arithematic Operators in C
Assignment Operators in C
Logical Operators in C
Constants
Constants in C
Violating-Constants in C
Structures
Initializing a Structure in C
Assignment of Structure in C
♦ Character Array in C
♣ Example1: Character Array in C
In this example, character arrays are defined in multiple ways.
Example
Input:
Run CODE
Reload Code
Copy Code
#include
#include
#include
int main() { // 1st way char *greet1="Yo Folks"; printf("%s\n", greet1); // 2nd way char greet2[]="Hello World!!"; printf("%s\n", greet2); // 3rd way char greet3[100]={'W','h','a','t','"','s',' ','U','P','\0'}; printf("%s\n", greet3); return 0; }
Output:
Arrays
Character Array in C