my favorite way is using getline(ifstream, string); and then i would just push everything on to a stack of type const char. you could also use vector, list, queue depending on what you need to use it for
That's the gets() that all the C docs warns against using?
From my manpages...
Never use gets(). Because it is impossible to tell without knowing the data in advance how many characters gets() will read, and because gets() will continue to store characters past the end of the buffer, it is extremely dangerous to use. It has been used to break computer security. Use fgets() instead.
after line 9 add another line to call strlen() to get the length of the line just read. If you want all the lines in the file then add them up into an int variable that you can use later in the program.
int sum = 0;
while( fgets(...) ) // replace ... with actual parameters
sum += strlen(text);
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...