const Matrix Matrix::operator+(const Matrix& rhs) const;
Can someone explain to me what each const is for in this function prototype?
Thanks.
Pier.
Type: Posts; User: MadStrum!
const Matrix Matrix::operator+(const Matrix& rhs) const;
Can someone explain to me what each const is for in this function prototype?
Thanks.
Pier.
Ok I get what you mean....
But I'm stuck with this way of implementing the structure because it was given to me in my assignment.
So I guess my method will work anyway?
Thanks for sharing the...
Do you mean this..
(resultMatrix->element) = new int*[resultMatrix->rows]; /*dynamic allocation of memory*/
for (i=0; i<(resultMatrix->rows); i++)
*((resultMatrix->element)+i) = new...
typedef struct {
int rows;
int cols;
int ** element;
} matrix;
Is there any difference between using this to get to the int element is pointing at
matrix * resultMatrix = new...
This is not I really want to do....
I want to extract the address only (everything after Address = ) and put it in the address array.
Pier.
Precisely.... in my case, I do not know how many elements there are in address. Therefore, when I use %s or %99s it can at most read in the 1st element
eg
Address = 103 smith street
when I...
Anyway, is there any short way to clear a string?
Instead of this :
for (i=0; i <= 100; i++) address[i] = ' ';
Pier.
I tried changing the %99c to %s and %99s, but it didn't work. This time the address was not even read in ...
Pier.
Below is part of my code. address[] is an array of 100 characters
I would like to ask how do I correctly terminate the address[] array so that when i call puts(address) only the current address is...
What do you mean by null terminating the strings ? What's the syntax like...
Sorry I posted the question again, but I don't seem to be able to delete the thread...
Pier.
upz
Sorry another similar question related to this
How do I read in a string
"DOB = 10-10-1970"
from a file and assign it to char arrays dob1, dob2 and dob3...?
this is my code
...
Just solved the problem using %lf instead of %f....
what the hell is the difference between using %lf and %f when reading from a file?!?!
argh... I spent two hours on this :(
Pier.
Within the customers text file it says :
Account Balance = 4000.00
int main() {
FILE * fp;
char one[80];
double theone;
fp = fopen("customers.txt", "r");
Ok! Damm I must have lost a memory module or something...
Pier.
Ok! Another simple question....
How do I detect it when fgets reads in a blank line?
Pier.
You're suggesting that I read each line using fgets and then process it internally using sscanf ?
Pier.
Let's say I have a file with the following characters
i suck at this
and I use fscanf() to access the text file.
After accessing 'i' , will the file pointer skip over i to the white space?...
Thanks a lot guys :)
Pier.
Let's say that I want scanf to process the following text
balance = 100
How do I skip over the word balance and the equal sign and capture only 100 and place it into an integer variable x?
...
Found this code inside accelerated c++...as an exercise....
I don't understand why the code does not work.. the bottom code...
It gives the following error
8...
Fark... think I was too used to typing fflush(stdin)...
thanks bro.
Pier.
I'm trying to read some characters from a file and change the case of the characters in the file.
Eg. in save.dat
LifeSux
It should turn out lIFEsUX, but it doesn't in this case, instead it gets...
Cool, Monster.... thanks a lot.
Pier.
I was looking for a recursive solution along the lines of my solution.... I'm sure it can be done... it's just that I don't know how :)
Pier.