syntax error [modified]
-
I am getting the following error: error C2143: syntax error : missing ')' before '&' on building the below code:
typedef unsigned int uint4;
void Find(uint4& a, uint4 b, uint4 c);
void Find(uint4& a, uint4 b, uint4 c)
{
. . . .
}I do not see any error in code. Any idea as to why this error is coming up?
modified on Tuesday, April 6, 2010 4:40 AM
-
I am getting the following error: error C2143: syntax error : missing ')' before '&' on building the below code:
typedef unsigned int uint4;
void Find(uint4& a, uint4 b, uint4 c);
void Find(uint4& a, uint4 b, uint4 c)
{
. . . .
}I do not see any error in code. Any idea as to why this error is coming up?
modified on Tuesday, April 6, 2010 4:40 AM
void Find(uint4& a, uint4 b, uint4 c,);
^What's the purpose of that comma? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
void Find(uint4& a, uint4 b, uint4 c,);
^What's the purpose of that comma? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]sorry thats a typing mistake here
-
I am getting the following error: error C2143: syntax error : missing ')' before '&' on building the below code:
typedef unsigned int uint4;
void Find(uint4& a, uint4 b, uint4 c);
void Find(uint4& a, uint4 b, uint4 c)
{
. . . .
}I do not see any error in code. Any idea as to why this error is coming up?
modified on Tuesday, April 6, 2010 4:40 AM
Your code compiles fine with my
C++
compiler (are you using aC
compiler?). :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Your code compiles fine with my
C++
compiler (are you using aC
compiler?). :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]yes I guess how to find that in visual studio I have written the code in a .cpp file
-
yes I guess how to find that in visual studio I have written the code in a .cpp file
.cpp
source files are compiled (by default) with theC++
compiler. However, the default behaviour may be overriden by the/TC
compiler option, see [^]. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
.cpp
source files are compiled (by default) with theC++
compiler. However, the default behaviour may be overriden by the/TC
compiler option, see [^]. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]Thanks Pallini for the inputs. I think I have got the bug. Actually in the VC project the file where I had been calling the fn. is .cpp while I have define it in a .c file. I guess this may be the problem.
-
Thanks Pallini for the inputs. I think I have got the bug. Actually in the VC project the file where I had been calling the fn. is .cpp while I have define it in a .c file. I guess this may be the problem.
rupeshkp728 wrote:
Actually in the VC project the file where I had been calling the fn. is .cpp while I have define it in a .c file. I guess this may be the problem.
Please note you cannot use references (e.g. '
uint4 &
' as your function's parameter) inC
language. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
rupeshkp728 wrote:
Actually in the VC project the file where I had been calling the fn. is .cpp while I have define it in a .c file. I guess this may be the problem.
Please note you cannot use references (e.g. '
uint4 &
' as your function's parameter) inC
language. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]yes I have changed the file name to .cpp