C++ extern function error: too many arguments to function

I have a cw.h file with a bunch of extern functions in it that I want to call from my cw.cpp file.

They are expressed like this in the .h. file along with the declarations of the Type struct (just example functions, not the actual names of the functions):

extern Type* new_type(), match(), sharetype();

But their definitions and implementations are in the cw.cpp file. Each of the functions has 1 or more parameters passed into it.

When I try compiling, I keep getting this error message for each of the functions:

cw.h:11: error: too many arguments to function Type new_type()
cw.cpp:575: error: at this point in file

I have no idea how to fix it. And I've been searching for the past hour (-_-)

EDIT[SOLVED]:

I changed my code in the .h file to match the types of the parameters being passed into the functions when they're being called. No more errors.

Answers


In C++, a function declared with () is a prototype and means that the function takes no arguments. In C++ it is equivalent to using (void). It doesn't have the same meaning as in C (i.e. that the function takes an unspecified number of arguments).


Need Your Help

Why can't I call Delegate.CreateDelegate in my Portable Class Library?

c# portable-class-library

I have the following problem: I want to call Delegate.CreateDelegate from within my Portable Class Library targeting .NET 4.5, Windows Phone 8 and Windows 8 Store Apps, but my code does not compile...

(SQL Server) using row count to sort the list but dont need list out the row count number

sql sql-server

All the column that inside the select sql are needed to list out ,except the row_number(),any solution to eliminate to row_count ?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.