Search:

Type: Posts; User: Zildjian

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    1,124

    Question on 2D Arrays

    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...
  2. Copying from one 2d array to another....with a twist

    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...
  3. Replies
    6
    Views
    3,502

    Ok, this is very bizarre. I've down some further...

    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...
  4. Replies
    6
    Views
    3,502

    Well, I did some debugging and figured out most...

    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...
  5. Replies
    6
    Views
    3,502

    Having a problem!

    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...
  6. Replies
    4
    Views
    1,206

    Ok, I've looked up how to use the time() function...

    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...
  7. Replies
    11
    Views
    2,815

    But I'm running this program on UNIX. Sorry, I...

    But I'm running this program on UNIX. Sorry, I should have mentioned that before.
  8. Replies
    11
    Views
    2,815

    I did that, but it doesn't seem to work. When it...

    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?
  9. Replies
    11
    Views
    2,815

    I tried putting that in my code and I get a...

    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>...
  10. Replies
    4
    Views
    1,206

    Interprocess Communication

    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];
  11. Replies
    11
    Views
    2,815

    Question About Blank Lines in Text Files

    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:
  12. Replies
    7
    Views
    3,787

    Thanks for all the help guys, but I figured out...

    Thanks for all the help guys, but I figured out what was wrong. I forgot to have a return os statement in my << method.
  13. Replies
    7
    Views
    3,787

    Annoying Segmentation Fault

    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...
  14. Replies
    4
    Views
    1,046

    Ok, the program is running now until the try...

    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?...
  15. Replies
    4
    Views
    1,046

    Confused with Exceptions

    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...
  16. Replies
    5
    Views
    1,806

    There we go, that did it! Thanks for the help.

    There we go, that did it! Thanks for the help.
  17. Replies
    5
    Views
    1,806

    I'm still getting errors when I try to compile....

    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;
    ...
  18. Replies
    5
    Views
    1,806

    Problem using overloaded

    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...
  19. Replies
    2
    Views
    1,041

    Ah, of course! I should have noticed that....

    Ah, of course! I should have noticed that. Thanks, everything's working great now.
  20. Replies
    2
    Views
    1,041

    Incorrect Output when Printing a Stack

    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...
  21. Replies
    9
    Views
    974

    Thanks, it works now! I wasn't putting the data...

    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...
  22. Replies
    9
    Views
    974

    Ok, how would I write a function that takes them...

    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++.
  23. Replies
    9
    Views
    974

    How would I go about making them global? Just...

    How would I go about making them global? Just declare them outside of the main function?
  24. Replies
    9
    Views
    974

    I can't do that because it gives me an error...

    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.
  25. Replies
    9
    Views
    974

    Problem Creating Functions

    Hello,

    I have the following code all written and working properly:


    #include <iostream>
    #include <fstream>
    #include <string>
    #include <list>
    #include <queue>
Results 1 to 25 of 69
Page 1 of 3 1 2 3