Hi;
(using C++) I am trying to count how many times a number is used in a column,
example:
23 45 67
45 67 89
23 45 67
this is the file I would like to count how many times in the first column the numbers are used in this case the result would be 23=2 45=1. 2nd column 45=2 67=1. 3rd column 67=2 89=1
the file I have is much larger.
this isn't school work this is something I am doing on my own.
thanks
so much
happy
Are those numbers in an array or... is it just a plain text file with numbers?
I'm new to C++ but not new to programming.
-If you mean the numbers are in a text file, seperated by white space, you could read it using a read-file function and put it into a multi-dimension array.
the example is not compilable with C or C++.], so you have to'create a simular function in C++.
If you put $ in front of the variable names, this example should work in PHP.
Thank you gamebuster
and yes I have the numbers in a text file so the code will be reading that infile. The result you show is want I am looking for.
thank you
happy