Hello,
After creating a 2D array and setting all the elements to 0 as follows:
char 2darray[10][10] = 0
How would one go about resetting the whole thing to contain all 0's again after...
Type: Posts; User: Zildjian
Hello,
After creating a 2D array and setting all the elements to 0 as follows:
char 2darray[10][10] = 0
How would one go about resetting the whole thing to contain all 0's again after...
Hello,
I'm trying to copy one 2d array in another. However, in the one that I'm copying into, I want to have spaces in between each letter and a space in between each row. Here is what I have so...
Ok, this is very bizarre. I've down some further testing and everything's being taken correctly out of each line of input. When I run the program with both data sets in the same file, I get results...
Well, I did some debugging and figured out most of my problems, but when I run it with the second set of input data, the output makes no sense at all. When I ran it through the debugger with this...
Hello,
I am having trouble getting a program I am working on to work. The problem I'm working on is located here:
http://www.cs.dal.ca/apics/contest04/E/E.txt
Here is my code:
#include...
Ok, I've looked up how to use the time() function and I can't seem to figure it out. Could you show me how I would go about using it in the context of my program? I tried to use and got a really huge...
But I'm running this program on UNIX. Sorry, I should have mentioned that before.
I did that, but it doesn't seem to work. When it encounters the blank line, it should print "A blank line!" but instead it prints nothing at all. Is there something else that needs to be done?
I tried putting that in my code and I get a compile error. I then tried putting double quotes around it, but I received no output. Here's my code with the new addition:
#include <iostream>...
Hello,
I am currently writing a program to create two processes and then have them communicate using a pipe. Here is my code:
#include <stdio.h>
int main() {
int pid, processes[2];
Hello,
I was just curious how blank lines are handled when using getline? Say I have a text file as follows:
And I have some simple code like this:
Thanks for all the help guys, but I figured out what was wrong. I forgot to have a return os statement in my << method.
Hello,
I am currently working on a data processing program. I am given various lines of input and I have to parse the information to see if it's valid or not. If it is, I put it in a queue. If...
Ok, the program is running now until the try statements in the test program. When it gets to the first one it just says abort instead of outputting the error messages. Now what am I doing wrong?...
Hello,
I'm trying to get my program to throw exceptions which will be caught by a separate program using my class. I've tried a number of different things, but none seemed to work. Here is the...
There we go, that did it! Thanks for the help.
I'm still getting errors when I try to compile. Here is my entire code for the class as it stands right now:
#include <iostream>
using namespace std;
class PolyLine {
double *x;
...
Hello,
I am currently creating a class to represent a PolyLine. I have all my methods working correctly, but I need to make an overloaded << operator. Here is the method I am using for testing...
Ah, of course! I should have noticed that. Thanks, everything's working great now.
Hello,
I'm getting an error when I try to print out a stack of objects. I want to have a stack that simulates the "Running Queue" in an operating system. I want to have one Process (represented by...
Thanks, it works now! I wasn't putting the data type that the queue would hold in my arguments. One more question, this is just for my general knowledge, but what is the purpose of those ampersands...
Ok, how would I write a function that takes them as arguments? I'm getting an error when I do it the way I think I'm supposed to do it. Sorry about all the questions but I'm new to C++.
How would I go about making them global? Just declare them outside of the main function?
I can't do that because it gives me an error saying that the queues that are used in that code are undeclared. For example, in the first bolded code, it says the queues ready and run are undeclared.
Hello,
I have the following code all written and working properly:
#include <iostream>
#include <fstream>
#include <string>
#include <list>
#include <queue>