Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
Build your AI Agent
GfG 160
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
Contests
Accenture Hackathon (Ending Soon!)
GfG Weekly [Rated Contest]
Job-A-Thon Hiring Challenge
All Contests and Events
DSA
Practice Problems
Python
C
C++
Java
Courses
Machine Learning
DevOps
Web Development
System Design
Aptitude
Projects
Sign In
▲
Similar Topics
C++
4k+ articles
C Language
1.8k+ articles
Articles
350+ articles
cpp-array
160+ articles
cpp-string
140+ articles
cpp-pointer
93 articles
c-array
34 articles
secure-coding
25 articles
C-programming
9 articles
gets
2 articles
C Array and String
17 posts
Popular Articles
Recent Articles
What's difference between char s[] and char *s in C?
Last Updated: 10 January 2025
Consider below two statements in C. What is the difference between the two? char s[] = "geeksquiz"; char *s = "geeksquiz";Below are the
...read more
cpp-string
C Language
Difference Between
C Array and String
Variable Length Arrays (VLAs) in C
Last Updated: 10 January 2025
In C, variable length arrays (VLAs) are also known as runtime-sized or variable-sized arrays. The size of such arrays is defined at run-time
...read more
cpp-array
C Language
C++
C Array and String
What are the data types for which it is not possible to create an array?
Last Updated: 18 December 2024
In C, an array is a collection of variables of the same data type, stored in contiguous memory locations. Arrays can store data of primitive
...read more
cpp-data-types
cpp-array
C Language
C Array and String
Similar Topics
C++
4k+ articles
C Language
1.8k+ articles
Articles
350+ articles
cpp-array
160+ articles
cpp-string
140+ articles
cpp-pointer
93+ articles
c-array
34+ articles
secure-coding
25+ articles
C-programming
9+ articles
gets
2+ articles
How to write long strings in Multi-lines C/C++?
Last Updated: 06 July 2023
Image a situation where we want to use or print a long long string in C or C++, how to do this? In C/C++, we can break a string at any poin
...read more
cpp-string
C Language
C++
C Array and String
How to pass a 2D array as a parameter in C?
Last Updated: 04 March 2025
A 2D array is essentially an array of arrays, where each element of the main array holds another array. In this article, we will see how to
...read more
cpp-parameter-passing
cpp-array
cpp-pointer
C Language
C Array and String
How to dynamically allocate a 2D array in C?
Last Updated: 10 January 2025
Following are different ways to create a 2D array on the heap (or dynamically allocate a 2D array).In the following examples, we have consid
...read more
cpp-array
cpp-pointer
C Language
C Array and String
Difference between Arrays and Pointers
Last Updated: 07 August 2023
The array and pointers are derived data types that have lots of differences and similarities. In some cases, we can even use pointers in pla
...read more
cpp-array
cpp-pointer
C Language
C Array and String
Initialization of variables sized arrays in C
Last Updated: 28 September 2018
The C99 standard allows variable sized arrays (see this). But, unlike the normal arrays, variable sized arrays cannot be initialized. For e
...read more
C Language
C Array and String
Are Array Members Deeply Copied?
Last Updated: 16 April 2025
In C++, we can assign a struct (or class) variable to another variable of same type. All members of one variable are copied to the other var
...read more
pointer
C Language
C Array and String
What is the difference between single quoted and double quoted declaration of char array?
Last Updated: 06 January 2025
In C programming, the way we declare and initialize a char array can differ based on whether we want to use a sequence of characters and str
...read more
C Language
C Array and String
Initialization of Multidimensional Array in C
Last Updated: 18 December 2024
In C, multidimensional arrays are the arrays that contain more than one dimensions. These arrays are useful when we need to store data in a
...read more
c-array
C Language
C++
C Array and String
Do Not Use sizeof For Array Parameters in C
Last Updated: 01 July 2022
Using sizeof directly to find the size of arrays can result in an error in the code, as array parameters are treated as pointers. Consider t
...read more
C Language
C++
C Array and String
gets() is risky to use!
Last Updated: 30 October 2023
Consider the below program.[tabby title="C"][sourcecode language="c"]void read(){ char str[20]; gets(str); printf(%s, str); return;}
...read more
Articles
C-programming
gets
secure-coding
C Language
C Array and String
C function to Swap strings
Last Updated: 18 April 2023
Let us consider the below program. [tabby title="C"][sourcecode language="c"]#includestdio.h void swap(char *str1, char *str2) { char *temp
...read more
C Language
C Array and String
Storage for Strings in C
Last Updated: 10 January 2025
In C, a string can be referred to either using a character pointer or as a character array.Strings as character arrays[GFGTABS] C
...read more
C Language
C Array and String
1
2
>>
Last
1
2
>>
Last
1
2
>>
Last
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !