S
sonu
Hi all,
from my code i want the out put should be 502 but its giving 7 pls any
one try to correct.
(Actualy i want to write a similar function as atol() which takes const
char * and gives long but i need my function should take const wchar_t
* and returns long.)
#include<stdlib.h>
int main()
{
long fun(const wchar_t *);
const wchar_t *a=L"a500";
const wchar_t *b=L"2";
long c;
c=fun(a)+fun(b);
printf("%d\n",c);
}
long fun(const wchar_t *a)
{
const char *b;
b=(const char *)a;
return atol(b);
}
Tkanks
Sonu
from my code i want the out put should be 502 but its giving 7 pls any
one try to correct.
(Actualy i want to write a similar function as atol() which takes const
char * and gives long but i need my function should take const wchar_t
* and returns long.)
#include<stdlib.h>
int main()
{
long fun(const wchar_t *);
const wchar_t *a=L"a500";
const wchar_t *b=L"2";
long c;
c=fun(a)+fun(b);
printf("%d\n",c);
}
long fun(const wchar_t *a)
{
const char *b;
b=(const char *)a;
return atol(b);
}
Tkanks
Sonu