I am working on a program in which I have the struct
struct molecule {
double x;
double y;
double z;
double const radius = .05;
};
When I compile with g++ without the pedantic flag...
Type: Posts; User: waterborne
I am working on a program in which I have the struct
struct molecule {
double x;
double y;
double z;
double const radius = .05;
};
When I compile with g++ without the pedantic flag...
Mathematical concepts used in programming is a very vague statement. What kind of programming do you have in mind? The kind of work I do is very math intensive while the programming a graphics person...
The problem was using setprecision on a char array. I changed the trouble line to:
outfile << std::setprecision(4) << atof(holder) << " ";
and that fixed the problem. Thanks for the help.
I tried that earlier (outfile.precision(4)) and it didn't work. I'll give fixed a shot.
EDIT:That didn't work either. I had this thought though. I read the data into holder which is a character...
I could have sworn I tried that earlier and it didn't work but sure enough that fixed the error. However, although it is running, it doesn't look like it is working correctly. My output is;
ATOM...
I am trying to use setprecision but I keep getting the error
RasMolMaker.cpp:124: error: ‘precision’ was not declared in this scope
I don't understand why I am getting this error when I...
What kind of errors would cause tellg() to give a position of -1? I've tried searching for this on Google but didn't have much luck. I know a value of -1 means failure but I don't know what are the...
Thanks for the clarification - that makes a lot of sense.
I guess I meant along the lines of opening a file and checking to make sure it actually opened. Things of that nature. It seems like there are a lot of different ways to do that but I have a feeling...
I was just curious what the recommended practice is when it comes to dealing with run-time errors. I have seen assert() used but I thought I read that it is not good practice to use assertions...
Thanks for the input! I looked up get() and getline() and made some changes. Now the code compiles and runs but ends after incorrectly reading 1 line. The new code is:
#include <fstream>...
I am writing a program that reads in a file and converts the data to a different format. I am having issues with using the end of file function. The program compiles with out any error but when I run...
I am using a fairly large software package (that presumably worked for the creator). I am getting an Undefined symbols error and all the files are object files. I don't know where to start with...
I don't understand what you said. Is that a comment or advice? This isn't a question on which function I should use but more of a best approach to this problem. Right now my solution is to have all...
I am having trouble finding a way to implement communication between processes using MPI. I have a cube split up into sub-cubes and each process is in charge of calculations over a certain subset of...
Since you have no math background or experience I would strongly recommend getting a tutor or taking some classes at a community college. My experience as a mathematician is that non-math people...
Using %02d did exactly what I was looking for.
There is no error in my program - I just did not post my program's output. I just put one column of numbers because those were the only ones I cared...
I think this is a very simple question but I haven't been able to find the answer in my book.
This is how I want the output to look
00
01
02
03
....
Ahh I just realized I don't need to allocate all that memory. Since I am doing this in parallel I only need to allocate memory for (2304/max_process_count)x(304/max_process_count) matrix, which in...
I am working on some code that multiplies 2 matrices in parallel. I statically allocate memory for the matrices so that each matrix has the memory to be 2304x2304. When I compile and run I get a...
I suppose if it were so obvious I wouldn't have asked the question in the first place. Either way, I appreciate the condescension.
That did the trick. I guess I was changing the value of the pointer in the original code and what I should have been doing is changing to value at the address the pointer points to (by using the...
I am modifying some code (which I did not originally code) and have come in to this error upon compiling:
Lvalue required as left operand of assignment
The problem occurs here:
temp +...
Here is my two cents.
I would start over from scratch. Your code is incredibly difficult to read without any indentation and it will probably be faster to just rewrite your code than get the...
If "return I_2" is executed it returns the I_2 value to the I_1a or I_1b from the previous else loop that called SimpsonQuad right? Then that else section returns a value to its previous else section...