Home Tutorialhelp Comment C++ Array of Structure inside a Structure?

 
 

Comment

Raef
C++ Array of Structure inside a Structure?,
November 24, 2009 at 6:11 AM

Im basically tryin to make a program that reads information about ships, where each ship can have information of several weapons read.

struct Ship
{
int speed;
int space;
int numW;
struct Weapon
{
char type [num];
int speed;
int space;
};
};

what would be the code to like cin>> weapon info
if for example we got array of boats: Ship x[n];
n--> number of ships to be read.

I tried using x[].y[].type;
but it didnt work, plz help
View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Java Beginners

C/C++ QUESTIONS
 

Java Beginners

C Structure
 

Java Beginners

C/C++ QUESTIONS
 

C++

C Tutorials
 

Design concepts & design patterns Questions

C++
 

Java Beginners

C++
 

CVS Questions

c++
 

Blog

Site map - C Tutorials
 

Java Beginners

basic c/c++ questions
 

Java Beginners

basic c/c++ questions
 

IoC Questions

Array in C
 

C Tutorials

C Array Declaration
 

Programming Tutorials

Linear and Non-Linear Data Structure in C
 

C Tutorials

C Structure Pointer
 

C Tutorials

C Dynamic Array
 

Mobile Applications Questions

Array Initialization in obj C
 

Java Interview Questions

How to create dynamic array in C?
 

Ajax Questions

c#
 

CVS Questions

C++
 

Development process Questions

C++
 

Development process Questions

c++
 

Ajax Questions

c#
 

Development process Questions

c++
 

Development process Questions

C++
 

Java Beginners

c++
 

Java Beginners

c++
 

Java Beginners

c++
 

Development process Questions

C++
 

Development process Questions

c++
 

Development process Questions

c++
 

Java Beginners

C/C++/JAVA Question on function
 

Development process Questions

c++
 

Java Beginners

C#
 

Development process Questions

C++
 

IoC Questions

C Language
 

Java Beginners

C Language
 

Development process Questions

C#
 

UML Questions

c++
 

UML Questions

c++
 

Development process Questions

c++
 

Development process Questions

c++
 

Development process Questions

C++
 

Spring Framework Questions

c++
 

Java Interview Questions

C interview questions
 

Java Interview Questions

C interview questions
 

UML Questions

c++
 

UML Questions

c++
 

UML Questions

c++
 

UML Questions

C++
 

Development process Questions

c++
 

UML Questions

c++
 

C Tutorials

C Structure example
 

Development process Questions

c++
 

Java Beginners

c++
 

IDE Questions

C program
 

SQL Question

c# (ado.net)
 

IDE Questions

c++ - IDE Questions
 

Programming Tutorials

C++Tutorials
 

Programming Tutorials

Pointer and Structure in C
 

Java Beginners

programming c#
 

Java Interview Questions

C - Java Interview Questions
 

General

Ask C/C++ Questions online
 

IDE Questions

c programme
 

Development process Questions

C,C++
 

C Tutorials

C Array length example
 

Development process Questions

C,C++
 

Programming Tutorials

Pointer in C
 

Java Interview Questions

about c and java
 

Struts Questions

Array of structure
 

Mobile Applications Questions

Select string from array in objective c
 

Programming Tutorials

Array Implementation in C
 

iPhone

Objective C Array
 

Framework Questions

c postfix - Framework
 

Programming Tutorials

Inverse of an array in C
 

Java Beginners

c++ - Java Beginners
 

Java Beginners

C Language - Java Beginners
 

Development process Questions

c/c++ - Development process
 

General

Java for C Developers
 

Development process Questions

C++ program not running
 

Tutorials

NSString in objective c
 

Java Beginners

Change case in C language
 

CVS Questions

a little pproblem in c++
 

Java Beginners

c++ - Java Beginners
 

IoC Questions

iphone sdk-objective c
 

Java Beginners

variable declaration in c and c++
 

Development process Questions

c/c++ - Development process
 

Java Beginners

C Program....PLEASE HELP
 

Java Interview Questions

Difference between C++ and Java - Java Interview Questions
 

Development process Questions

concatenation of Two bytes in C
 

Development process Questions

C/C++ - Development process
 

Development process Questions

c/c++ - Development process
 

Development process Questions

c/c++ - Development process
 

Development process Questions

C++ Starter needs help :S
 

Java Beginners

c c++ - Java Beginners
 

Java Beginners

c or c++ - Java Beginners
 

Eclipse Plugins

Cantata++ - for testing C and C++ software
 

Java Beginners

c c++ - Java Beginners
 

Swing AWT

c c++ - Swing AWT
 

Struts Questions

please help me to answers this question about C++.....huuhuhuhu
 

HTML Questions

please help me to answers this question about C++.....huuhuhuhu
 

Advertisements Advertisements
 

 

 

DMCA.com