473,395 Members | 1,885 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,395 software developers and data experts.

code wont run, have error

18
ok, after i put these code n compile n run, gt some error :

"
[Linker error] undefined reference to `addstudentMODULE(int)'
[Linker error] undefined reference to `displayMODULE(int)'
ld returned 1 exit status
"

here is my source code:
Expand|Select|Wrap|Line Numbers
  1. Full code removed - please read Posting Guidelines
  2.  
why is tt few error keep popping up, if i removed the "addstudentMODULE(1);" in line 68 as well as "displayMODULE(2);" in line 76, the programe will run, can any1 help me check on it, i've been stuck there for fews days already. Thank you very much.

note: i m using dev C++
Jul 18 '08 #1
5 1334
newb16
687 512MB
Expand|Select|Wrap|Line Numbers
  1. int displayMODULE(int num);
  2. {
  3. stud infor[MAX_STUDENT];
  4.  
ewe shld remove semicolon after function definition - compiler treats it like second declaration or whatever.
Jul 18 '08 #2
xiaolim
18
if i removed the semicolon, the errors become:

In function `int main()':
122 a function-definition is not allowed here before '{' token
122 expected `,' or `;' before '{' token
Jul 18 '08 #3
Banfa
9,065 Expert Mod 8TB
You can not define functions (displayMODULE) inside other functions (main).
Jul 18 '08 #4
xiaolim
18
but then i wanted to call back the functions after user had chosen tt option as well as displaying all the record that is in the database, if i cant define, den is there ani other way?
Jul 18 '08 #5
JosAH
11,448 Expert 8TB
but then i wanted to call back the functions after user had chosen tt option as well as displaying all the record that is in the database, if i cant define, den is there ani other way?
As Banfa already wrote: you can't define a functions in the body of other function
definitions; C and C++ don't support local functions. Of course you can define
functions *outside* of those other function bodies; that's the place where normal
top-level functions reside.

kind regards,

Jos
Jul 18 '08 #6

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

Similar topics

0
by: ht | last post by:
hi all, im kinda new to vb and i have code that unhides a hidden from on a key press for some reason though this code only works when running th app through by, ie. it wont work in the...
242
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any...
1
by: Ken.r | last post by:
I'm working my way throught ASP Resource Kit tutorial lab 3. This following code was working in the HTML page: private void btnSignIn_Click(object sender, System.EventArgs e) { // Add user...
7
by: dhnriverside | last post by:
Hi guys I've got a web application on a Win2k IIS5 server. I've been coding it using anonymous access, and have just come to test the AD stuff - trouble is - all i get is a 402.1 error ("not...
4
by: dhnriverside | last post by:
HI guys I've just written my first independent namespace for my library (yay me!). However, on trying to add it to my website project, it causes an error when I look at the website. It compiles...
4
by: Harry Hudini | last post by:
I'm trying to install VS .Net, particularly the VB elements, but no matter what i select, i get an error at the end of the process simply saying that an error occurred. The installlog.txt file...
3
by: Brian Henry | last post by:
every time i try to run my asp.net 2.0 app it says Server Application Unavailable The web application you are attempting to access on this web server is currently unavailable. Please hit the...
1
by: Jia Lu | last post by:
Hello I have a program that can telnet to a host. But I cannot understand from part, can anyone explain it to me? Thank you very much. import sys, posix, time
36
by: The Frog | last post by:
Hi Everyone, I am trying to find a solution for handling zipped data without the need to ship / install any DLL files with the database. Does anybody know of code to handle ZIP files that does...
0
by: sourpo | last post by:
wonder if anyone can help... I have access db with a whole lot of vb code... If i use access 2000 it works perfectly but when using 2003 it doesn't work properly. The db copies outlook mailboxes......
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.