A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
C / C++
how to treat characters in a string like integers?
Joined: Feb 11, 2012
Aug 28, 2012 00:07:22
how to treat characters in a
hey guys i have a simple function which reads in two integer arrays and outputs the number of same elements in the 2 arrays.
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
It is sorta covered in the
JavaRanch Style Guide
subject: how to treat characters in a string like integers?
Read this: (12,13,14) + (100,2,43,54) into two arrays
String optimization weirdness
Comparing Array Elements
sum of two int arrays
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014