Search:

Type: Posts; User: chickenlittle

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    17
    Views
    2,370

    C++ Programming from problem analysis to program...

    C++ Programming from problem analysis to program design 5th edition by D.S. Malik
  2. Replies
    17
    Views
    2,370

    I have never worked with vector before.

    I have never worked with vector before.
  3. Replies
    17
    Views
    2,370

    Yes that would work in main however if I put it...

    Yes that would work in main however if I put it into the account2 struct I would get an error


    struct account2
    {
    account2();
    account x;
    account* data = &x;
    void change();
    };
  4. Replies
    17
    Views
    2,370

    So shouldn't data->accountnum = 1000 work? How...

    So shouldn't data->accountnum = 1000 work? How would you change the value of accountnum from the struct account then?
  5. Replies
    17
    Views
    2,370

    I'm not really sure. I am going by this c++...

    I'm not really sure. I am going by this c++ pointer guide, Use -> for structure pointer : structure pointer « Structure « C++ Tutorial.
  6. Replies
    17
    Views
    2,370

    Yes both data->accountnum = 1000; cout

    Yes both


    data->accountnum = 1000;
    cout << data->accountnum << endl;

    will not work.

    Is account * data; the problem then?
  7. Replies
    17
    Views
    2,370

    "Your account2 object's member pointer does not...

    "Your account2 object's member pointer does not point to a valid account object." I keep reading but I still don't quite understand what you are trying to say. I think account * data; correct. Please...
  8. Replies
    17
    Views
    2,370

    Do you mean this is the problem? void...

    Do you mean this is the problem?



    void account2::test()
    {
    data->accountnum = 1000;
    }
  9. Replies
    17
    Views
    2,370

    Quick question about pointers!

    #include <iostream>
    using namespace std;

    struct account
    {
    account();
    int accountnum;
    float balance;
    float interestrate;
    };
  10. But isn't the breadth first search best for...

    But isn't the breadth first search best for finding the shortest path? That is what my main objective is.

    I have tried to store the nodes that the program visits but would it outputs it back to...
  11. But how would I do that? Say a starting point I...

    But how would I do that? Say a starting point I picked has four open spaces next to it(up, down, left, and right) and the exit point I want is two spaces right of the starting point. Using the...
  12. Need help with finding the shortest coordinate of a maze

    Hi I have a 16x16 maze where 1's represent walls and 0's represents paths.

    I used a breadth first search algorithm and my program successfully finds a path from a user specified start to a user...
  13. But how would you check to see if the string...

    But how would you check to see if the string contains numbers or math operators? That is where I am stuck in. Would we use stringstream?
  14. How to analyze a string for numbers or other characters

    I am trying to write a program that can do postfix expressions in c++. First I have to read in the user input as a string. But how would I break up the string so I can tell whether each data is a...
  15. Replies
    9
    Views
    5,982

    Nope this is a school project and I have to use...

    Nope this is a school project and I have to use char name[15]. It is c++ so this is the right place. Not very sure how to compare the names though.
  16. Replies
    9
    Views
    5,982

    How to sort linked list alphabetically

    Hi I want to input names into a linked list and sort them as they go in. So if the name Google is already in the list, then Yahoo should go behind it. And if Firefox is being inputted into the list...
  17. Replies
    4
    Views
    1,285

    Thank you for your input. Is there a method to...

    Thank you for your input. Is there a method to insert it at the end of the list without using a tail?
  18. Replies
    4
    Views
    1,285

    Linked list printing out backwards

    I am having problems with adding new items into a linked list.

    Here is my add function for the linked list:

    void List::addNode(const Product & info)
    {
    NodeType* ptr = new NodeType;...
  19. Ah I see. Thank you so much!

    Ah I see. Thank you so much!
  20. Reading from a textfile with unknown length?

    [c++] Need help with pointers?
    Hi I want to make a program that can read data from a text file into memory.

    Here is the format of the text file:
    Quantity
    Brand
    Cost

    So text file 1 could be:...
  21. This is a demo of what my teacher gave me on...

    This is a demo of what my teacher gave me on classes:
    main.cpp:

    #include "Demo.h"
    #include <iostream>
    using namespace std;

    int main()
    {
    DateType a, b(5,4,2010), c(32,-1,2023);
  22. I'm supposed to have this in my class inside the...

    I'm supposed to have this in my class inside the header file:
    void readCheck(ifstream&);

    Where would I use that function? Inside my main or header?
  23. Need help with outputting data from a class

    Hi I am stuck on how to output data that I got from a text file.

    The text file looks like this:
    1 5
    2 6
    3 7
    4 8
    5 9

    6 10
  24. Replies
    2
    Views
    8,047

    What is ifstream& for?

    I have a classes project and one function I need inside of the class is called check(ifstream&). I am suppose to read from a text file and then check it against a set of data that is already written...
  25. Replies
    5
    Views
    1,088

    Thank you for the quick reply. That is exactly...

    Thank you for the quick reply. That is exactly where I am stuck. I figured out how to calculate the average cost and compare them. But I don't know how to sort it. Do I use for loops and junk...
Results 1 to 25 of 45
Page 1 of 2 1 2