|
| ||||||||||
| Tags: c sharp, function, library, turbo c |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| C# User defined function added in library but no error
I am learning C++ & I have added a function to the standard library math.lib in my turbo C++ compiler. I have not declared the prototype for this function & neither i have used any header file too. This must get me an error message but it do not give me any error. I dont understand why is this happening? Anyone could answer this to me? |
|
#2
| ||||
| ||||
| Re: C# User defined function added in library but no error
I don't think you are not getting any error with this thing! You must be getting an error IF you call this new function at the compile time & if you are not calling then it wont give you any error message thats a simple thing! What are you using int or Void? |
|
#3
| ||||
| ||||
| Re: C# User defined function added in library but no error
1. If you call an undeclared function then the C Standard mandates that the function return value is assumed to be int and the arguments are handled as in the pre-ANSI, pre-prototype, days of K&R C where the argument type is inferred from the value/variable that is passed in the function call. This is not a formal error condition so it is not surprising that you don't get a compiler error. It is disappointing that you don't get a compiler warning. 2. What is the prototype of your function? If it doesn't match the inferred K&R prototype then you can expect bugs. However, there need not be a dramatically announced run-time error -- you will just get the wrong answer. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "C# User defined function added in library but no error" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What are user defined exceptions in Java? | Migueel | Software Development | 5 | 30-11-2009 06:27 PM |
| How to create user-defined service on Windows XP | killerboy | Operating Systems | 2 | 31-07-2009 11:37 PM |
| end user defined characters | Gunter | Windows Software | 4 | 13-07-2009 09:36 AM |
| Create user defined functions in Excel 2007 | AbhayD | Windows Software | 3 | 24-06-2009 07:05 PM |
| When to create User Defined Data Type in VB.Net | Nihar Khan | Software Development | 3 | 27-02-2009 10:29 AM |