0

Hi,
I've written some fnc and when I tested it it works perfectly but when I switch from debug mode to release mode I'm getting error:
Intrisinc function, cannot be defined. Any idea what's wrong?

typedef unsigned int u_int;
int strcmp(const char* s, const char* s1)
{
	u_int size_s = 0;
	while (*s) //getting size of first c-string
	{
		++size_s;
		++s;
	}
	s -= size_s; //moving to the beginning
	u_int size_s1 = 0;
	while (*s1)//getting size of second c-string
	{
		++size_s1;
		++s1;
	}
	s1 -= size_s1; //moving to the beginning
	s_int result = 0;
	while (*s && *s1 && (!result))
	{
		result = *s - *s1;
		++s;
		++s1;
	}
	if (!result && (size_s < size_s1))
	{
		result -= 1;
	}
	if (!result && (size_s > size_s1))
	{
		result += 1;
	}
return result;
}

Thanks for any help.

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by atch
0

Have you included the <cstring> library and have the following declared using namespace std; If so I think that the compiler is confused on using your strcmp function or the one that is already defined in the cstring header.

Or else even if you have not included the header file. Your compiler is still confused of ambiguity because of THIS!! clicky

0

Sky Diploma thank you. Renaming fnc made the difference.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.