473,387 Members | 1,799 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.

Display Student Record..

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->student_number << endl;
  6.                 cout << "Student  Name: " << record->studentname << endl;
  7.                 cout << "Student Address: " << record->Address << endl;
  8.                 cout << "Course Code: " << record->CourseCode << endl;
  9.                 cout << "Course Name: " << record->CourseName << endl;
  10.  
  11.             }
  12.     }
As you can see from my Screen shot when i click on Display Student Records Screen Shot its giving me the First Student in the Array 10 Times.. its not giving me all the Names...

Expand|Select|Wrap|Line Numbers
  1.     int n,k,key;    
  2.  
  3.     for (n = 0; n < N_STUDENT;n++)
  4.     {
  5.            while((cout<<"Enter Student Number: ")&&(!(cin>>record[n].student_number)||record[n].student_number<0)){
  6.             cout<<"Invalid Input!"<<endl;
  7.             cin.clear();
  8.             cin.ignore(1000,'\n'); 
  9.         }
  10.  
what am i doing wrong
Attached Images
File Type: jpg Screen shot 2011-04-15 at 22.27.46.jpg (62.2 KB, 229 views)
Apr 15 '11 #1

✓ answered by Rabbit

Try a . instead, in your code you were using -> so I left that alone but it looks like that might be wrong as well.

4 2682
Rabbit
12,516 Expert Mod 8TB
You're not iterating through you record array in the output. You're just using record-> rather than record[n]->.
Apr 15 '11 #2
ok then that record[n]-> and giving me
Member reference type 'Student' is not a pointer..
Apr 15 '11 #3
Rabbit
12,516 Expert Mod 8TB
Try a . instead, in your code you were using -> so I left that alone but it looks like that might be wrong as well.
Apr 15 '11 #4
ok the record[n].studentname etc. works really well thanks
Apr 15 '11 #5

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

Similar topics

4
by: dr. zoidberg | last post by:
Hello, I'm pulling news titles from MySQL. How Can I display first record in bold (different than other ones). What is the best way to do that. Is there some 'magic' query or PHP function. ...
2
by: Anderson | last post by:
Does anyone have a sample student record system in access. Or would you point me somewhere where I can get examples. many thanks. Andy
2
by: bobh | last post by:
In Access97 on a bound form, client wants a button that will duplicate the currently displayed record and give it a new meeting nbr. I have done it except for being able to display the new record...
2
by: sheenaa | last post by:
Hi, I want to display the last recorded record in the database of SQL SERVER 2005. How can i display it with the select query in the grid view... The database contains the...
1
by: Coll | last post by:
Hi - I'm trying to figure out how to append a record to a table and then open a form and display that record. My thought was to use the autonum primary key field (recordnum) and display the highest...
1
by: reymar | last post by:
1. What is the best software application in developing a database for Student Record System? 2. How to develop an Automated Student Record System? 3. What are the factors to be considered in...
6
by: Gilberto | last post by:
Hello I have a table (BOM TOTAL L1 V1) created by a query which only contains one field (TCL1) with ONE record. I've been trying to display this record on a form (either in a textbox or a label)...
8
Ali Rizwan
by: Ali Rizwan | last post by:
Here is the question. Write a program that will get a record of the student i.e. Name, Fathers Name, Degree Studying, Phone Number, and Date Of Birth and Then Show the record of the student? ...
21
by: postman | last post by:
I have a subform which is bound to a query which will display records using an ID# supplied from a listbox in the parent form. That same subform is also used to create new records using the...
5
by: saga git | last post by:
how to display nth record from table
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
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.