Results 1 to 3 of 3

Thread: C# User defined function added in library but no error

  1. #1
    Join Date
    Jan 2009
    Posts
    18

    C# User defined function added in library but no error

    Hi,
    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. #2
    Join Date
    Jan 2009
    Posts
    44

    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. #3
    Join Date
    May 2008
    Posts
    2,297

    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.

Similar Threads

  1. What are user defined exceptions in Java?
    By Migueel in forum Software Development
    Replies: 5
    Last Post: 30-11-2009, 07:27 PM
  2. How to create user-defined service on Windows XP
    By killerboy in forum Operating Systems
    Replies: 2
    Last Post: 31-07-2009, 11:37 PM
  3. end user defined characters
    By Gunter in forum Windows Software
    Replies: 4
    Last Post: 13-07-2009, 09:36 AM
  4. Create user defined functions in Excel 2007
    By AbhayD in forum Windows Software
    Replies: 3
    Last Post: 24-06-2009, 07:05 PM
  5. When to create User Defined Data Type in VB.Net
    By Nihar Khan in forum Software Development
    Replies: 3
    Last Post: 27-02-2009, 11:29 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,772,199.20439 seconds with 17 queries