Thread: Arguing with my compiler (constructor failure)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826

    Arguing with my compiler (constructor failure)

    File1:
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Fie;
    namespace TwoArgConstructor
    {
        class Program
        {
            Foo myfoo;
            static void Main(string[] args)
            {
            }
            public void Initialize()
            {
                myfoo = new Foo(1, 2);
            }
        }
    }
    File2:
    Code:
    namespace Fie
    {
        class Foo
        {
            Foo(int a, int b) { }
    
        }
    }
    Error: Fie.Foo does not contain a constructor that takes two arguments

    Yes it does! Can anyone see what is wrong here?

    Quzah.
    Last edited by quzah; 09-24-2011 at 06:19 PM.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What does a call to `some` constructor mean to the compiler ?
    By manasij7479 in forum C++ Programming
    Replies: 8
    Last Post: 06-22-2011, 11:20 AM
  2. Replies: 6
    Last Post: 05-19-2010, 04:03 AM
  3. Constructor failure
    By Brian in forum C++ Programming
    Replies: 5
    Last Post: 02-24-2005, 02:57 PM
  4. compiler error on class constructor
    By skorman00 in forum C++ Programming
    Replies: 4
    Last Post: 11-05-2003, 12:02 AM