473,387 Members | 1,687 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Showing Array, and showing Records

I'm trying to show out my array
Expand|Select|Wrap|Line Numbers
  1. else if (choice == 6)
  2.         {
  3.             const int student; // Array Size
  4.             int N_STUDENT[record]; //the array
  5.             //initialize values
  6.             for (int i=0;i<student;i++) //go through all elements
  7.             cout<<i<<'\t'<<student[n]<<endl; //print indexnumber and value
  8.         }
  9.  
And show the Record after they were Enter in by User

Expand|Select|Wrap|Line Numbers
  1. else if ( choice == 1)            
  2.             for (int n = 0; n < N_STUDENT;n++)
  3.             {        
  4.  
  5.                 cout << "Student Number: " << record[n].student_number << endl;
  6.                 cout << "Student  Name: " << record[n].studentname << endl;
  7.                 cout << "Student Address: " << record[n].Address << endl;
  8.                 cout << "Course Code: " << record[n].CourseCode << endl;
  9.                 cout << "Course Name: " << record[n].CourseName << endl;
  10.  
  11.             }
  12.     }
  13.  
this is my array
Expand|Select|Wrap|Line Numbers
  1. struct  student
  2. {
  3.     int student_number;              // Student number of student
  4.     string studentname;             // Name of student
  5.     string Address;                //Address of Studnet
  6.     int CourseCode;               //Course Code 
  7.     string CourseName;           // Name of Course 
  8. };
  9. student record[N_STUDENT];
  10.  
Its giving me an Error of Default Initialization of an object of const type 'Const int' on
Expand|Select|Wrap|Line Numbers
  1.  const int student; // Array Size
Apr 7 '11 #1
1 1794
OK just got the Read in Student Record in Working
Just Change the out
Expand|Select|Wrap|Line Numbers
  1. << "Student Number: " << record[n].student_number << endl;
To
Expand|Select|Wrap|Line Numbers
  1. out << "Student Number: " << record->student_number << endl;
just trying to fix the Read in Array
Apr 7 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Janusz Jasinski | last post by:
Hi, Below is my code to display an XML within a HTML page. I would only like to let the user see 10 records at a time, how do I do this. Also how do I set the navigation for them to go through...
0
by: Tony Williams | last post by:
I have a main form based on "tblmonth" which has a control "txtmonthlabela" (based on a field of the same name) My subform based on a query "qryFDAsubform" which is based on my table "tblmaintabs"...
2
by: ricktech101 | last post by:
Hi, I have a table with a field that shows the number of pieces that a parcel contains. It looks like this: ParcelID, Pieces, Description Data example: 1001, 5, Jackets 1002, 10, shoes etc
2
by: John Bailo | last post by:
I imported 600,000 records from SQL Server 2005 to mySQL. I know they are in there -- I just can't see them! When I do a SELECT, it processes for a while, and then returns nothing. Same with...
1
by: Miro | last post by:
VB 2005 Express. I can create a simple MDI app, with 2 forms. On Form1 I add a menustrip on top - and click on ( Insert Standard Items ) Add a ToolStrip as well and add 2 buttons. On Form2,...
1
by: jasone | last post by:
Hi all, ive got a search working, as shown below... on the page i want to show how many records are returned, im sure this is pretty simple but cant really work it out. any help or advice...
2
by: Neish | last post by:
how do you create and populate an array of records and store those records into a file
6
by: Spenca | last post by:
I am to create an array of records, for students including the basic info-ID, First&Lastname, DOB,address,tele number,program doing. Whats the correct approach to doing this?
10
by: temo | last post by:
Hello I’m fairly new to access, and have run into a problem with designing a small app. I have 3 tables that I have linked from one table with field: cusCustomersID tblCustomers cusCustomersID ...
6
by: Ryno Bower | last post by:
Hi guys. I have two tables: Operators and Roles Fields - Operators Operator (primary key) UserName etc Fields - Roles Operator
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.