aspose file tools*
The moose likes C / C++ and the fly likes how to treat characters in a string like integers? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » C / C++
Bookmark "how to treat characters in a string like integers?" Watch "how to treat characters in a string like integers?" New topic
Author

how to treat characters in a string like integers?

thejwal pavithran
Ranch Hand

Joined: Feb 11, 2012
Posts: 118
how to treat characters in a string like integers?
hey guys i have a simple function which reads in two integer arrays and outputs the number of same elements in the 2 arrays.

eg:
input:
{11,22,12,13}
{44,55,22,11}

the output will be 2 here.

my function prototype is:

void compare(int list1[],int list2[]);

but theres a glitch.

the modules which call the function pass the lists as character arrays.

So now i should rewrite the function and the prototype would be:

void compare(char* input1,char* input2);

I have absolutely no idea on how to compare two integers thus way. can Somebody please tell me how to compare two integers if the belong to a char array


on job hunt
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to treat characters in a string like integers?