Ah, thanks for the quick reply. Seems like that was it.
Type: Posts; User: Kaiser
Ah, thanks for the quick reply. Seems like that was it.
Does anyone know why the following code segfaults? Valgrind gives me no hints.
I compile with 'g++ knas.cpp -pedantic -Wall -ansi -g -o knas' and get no errors/warnings.
#include <algorithm>...
That is simple to tell, since there's a function called eof() in ifstream, which returns true if you're at the end of file and false otherwise.
And yes, I could easily post the code for this, but...
Start by taking one value from each file (say x comes from A and y comes from B).
P: Now compare x and y, record the smallest to a file, remember the other one. If x was the smallest, read a new...
I tink that was what I was looking for, thank you! It's too late to try it now, but tomorrow.. :)
Well I did update my code, so just check it. It should be really simple to understand as well.
Oh, I had done a bracket typo in my code. It is functional now.
The reason it outputted strange characters was that I forgot to terminate the string with a '\0'. And I had forgot to increment i in...
cols is not the same as columns, and should not be.
I have a matrix A of type [m x n]. In that matrix, I want to have an operator* which will take a matrix B of type [n x p] as an argument, and...
My code works perfectly well. If you please post yours it will be easier to find what you are doing wrong.
I took a look at the SVG example file http://www.w3schools.com/svg/rect1.svg
So in practice I just output an identical document, except for the height and width variables.
#include <fstream>...
To me that seems quite easy. First create a SVG document with a rectangle, take a look at the source. Now, what depends on user input?
Where is the problem? What have you done so far?
With SVG, do you mean Scalar Vector Graphics? In that case, what exactly do you want to output as an SVG document?
The copying is already done, so you just output it. The entire program would look something like this:
int main() {
char Fname[10];
char Lname[10];
char Fullname[20];
cout <<...
I don't get the question. I though you wanted to 'cin >> Fname;' and 'cin >> Lname;', and then do the copying.
When working with arrays, the assignment operator does not do what you might think....
His code is perfectly correct, but as you said in the first post that you are not to use any built in string handling, it is not what you asked for.
First of all, you need to define Fullname as an array of 20 characters (including null termination), as 'char fullname[20];'. The loop(s) could be something like:
int i = 0;
while (Fname[i]...
Yes, but if you had taken the time to read his message, you would have known that was not what he wanted to do.
peckitt99:
In your code, Fullname cannot possibly store the concatenated string,...
I am implementing a class for matrices (the mathematical object), and I am unsure how the definition for the multiplication operator should look. My class is defined as:
template <class T, int...