C++ without fear by Brian Overland has a great example on how to normalize fractions including on how to find greatest common factor and lowest common multiple. It is one of the two books I am using to muck my way thru learning cpp. Check out example 11.3, it goes something like:
Spoonfeeding code removed - giving them the answer teaches them nothing, giving them an algorithm still makes them think about coding it (and hopefully...
User Profile
Collapse
-
Sorry was thinking out loud with last post :).
What it boils down to is, I want to have access to individual columns contained within the file with the ability to search by protocol, local IP etc The file has the form of the following on each line, each column entry is seperated by a whitespace:
...Code:struct mystruct { char date[10]; char time[11]; char direction[1]; char remoteip[15];Leave a comment:
-
Thank you :)
I can loop thru a vector using a normal index.
Also I can loop thru a vector using a vector<type>::c onst_iterator that represents an address within a vector for use with *.
Now to stuff the vector into an array for information parsing and gathering.
bobLeave a comment:
-
vector<string> to array question: very new to this
Hello,
This is my first attempt at a c++ program, and it is a long post, please bear with me.
I'm trying to read in a text file containing a firewall log, make the information searchable by an element (protocol, remote ip etc). The file is of known max width (65) containing 8 columns of known max size. The columns are seperated by white space. However, it is of unknown length. I read that to input this file in,...
No activity results to display
Show More
Leave a comment: