http://libraryofcprograms.blogspot.com/2013/03/initializing-character-array-structs.html
Is there any other way to initialize a chararcter type array in structs?
MRehanQadri
0
Junior Poster in Training
Recommended Answers
Jump to PostUsing the initializer list you can take advantage of initialization rules:
#include <iostream> using namespace std; struct a { double id; int tag; char array[10]; }; int main() { a var1 = {100, 1, "The City"}; a var2 = var1; cout << "var2.id = " << var2.id …
Jump to PostIgnoring variations of the following, you can initialize it manually member-by-member, copy it from an existing object, use an initializer list, or define a constructor.
All 6 Replies
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
MRehanQadri
0
Junior Poster in Training
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
MRehanQadri
0
Junior Poster in Training
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
MRehanQadri
0
Junior Poster in Training
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.