Search:

Type: Posts; User: dnguyen1022

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    4,902

    C2100 Illegal Indirection error?

    So this is my code..



    vector<string> frame(const vector<string>& v){
    vector<string> ret;
    string::size_type maxlen = width(v);
    string border(maxlen + 4, '*');

    //write the top border
  2. Replies
    5
    Views
    1,338

    I can see that if s.size() is greater than...

    I can see that if s.size() is greater than width1, a negative amount of spaces would be appended to string s, which I assume returns an error?

    As for the words.size() being less than...
  3. Replies
    5
    Views
    1,338

    Hm..from what I think, the top loop keeps the...

    Hm..from what I think, the top loop keeps the same string around, while the second makes a new instance everytime. I would assume the first loop would just keep adding more characters to the...
  4. Replies
    5
    Views
    1,338

    Difference between these two codes

    So I'm following my C++ textbook and its asking me why the top one doesn't work but the bottom does. I see that string s is defined outside in one, and inside of the while loop in the other. When...
  5. Replies
    5
    Views
    9,767

    Thank you laserlight. it worked brilliantly!

    Thank you laserlight. it worked brilliantly!
  6. Replies
    5
    Views
    9,767

    I am using a list for the container. As for...

    I am using a list for the container.

    As for your suggestion anon with the loop, I tried decrementing the iterator everytime i erased the element from the list, but it gives me an error saying the...
  7. Replies
    5
    Views
    9,767

    Iterator not incrementable?

    So I am trying to write up two versions of a function, that takes in a list of data structure of students(which consists of their name and grades), and filters out all the failing students, and...
  8. Replies
    4
    Views
    1,749

    Hm..sounds sort of complicated..what would say...

    Hm..sounds sort of complicated..what would say would be a "beginner" type of research? Say...at the low-mid undergrad levels. Excluding students who excel at what they do of course..
  9. Replies
    4
    Views
    1,749

    How does research with CS work?

    So I was thinking about possibly doing research in the future as a Computer Science major...however something left me kind of stumped. How does research work in Computer Science? For medical...
  10. Replies
    2
    Views
    5,987

    what does it mean with this part? ...which...

    what does it mean with this part?



    ...which all the lines of the original picture are padded out to their full width
  11. Replies
    2
    Views
    5,987

    Need help understanding a problem

    Hi all,
    I need help understanding a problem given in the Accelerated C++ book on page 100, problem 5-5.

    The problem states


    Write a function named center(const vector<string>&) that returns a...
  12. Replies
    1
    Views
    1,367

    Need help with list sorting

    Okay so previously, I attempted to sort of create a generic type of program. I did this by using typedef to define two vectors. One of structs and one of doubles. However when I changed the...
  13. Can't seem to access the Struct within my vector

    Hello, so I am trying to create a small mini program that iterates through a vector and outputs something according to a book. I have no problem understanding the problem, but I came across a...
  14. Replies
    1
    Views
    2,212

    Typedef in a header?

    I am trying to do a problem that I can apply to both lists or vectors using an interator, and all I would have to do to change the problem is within a typedef declaration. However it does not...
  15. Replies
    8
    Views
    1,170

    Yes, or you can ask the user for the string...

    Yes, or you can ask the user for the string rather than within the body of your code.
  16. Replies
    7
    Views
    1,359

    I apologize, but I renamed one of the argument...

    I apologize, but I renamed one of the argument variables as I was typing this up. I didn't realize it was the same name as the function. The book had it as "is" but sometimes I name whatever the...
  17. Replies
    8
    Views
    1,170

    from the way I understand it, it looks like you...

    from the way I understand it, it looks like you give it a number and a string. That number will determine what letter you start at from the string. From where you start at, determine if there are 4...
  18. Replies
    7
    Views
    1,359

    istream question

    Hello all, so I am writing up a few programs according to the book. However I do not entirely get what it is saying.



    istream& read(istream& read, Student_info& student){
    read >>...
  19. Replies
    3
    Views
    825

    Ok I understand now, Thanks!...so with a code...

    Ok I understand now, Thanks!...so with a code like this



    //the containers
    list<list<string>> sentences;
    list<string> sentence;
    string x;

    //adds user input to container
  20. Replies
    3
    Views
    825

    Question about new lines and lists

    Hello all,
    So I have a question...So suppose I create a program that simply takes in my input and stores it into a list and then I output the list. Normally for my compiler (Vistual Studio), in...
  21. Replies
    9
    Views
    19,727

    Yes, this would work perfectly, but why would my...

    Yes, this would work perfectly, but why would my last code not work? Does rbegin() not reference to the last element of the list?
  22. Replies
    9
    Views
    19,727

    Yes I am trying to loop through all the items...

    Yes I am trying to loop through all the items except the last one.

    If rbegin() is what I am looking for then this should work..but its not.



    for(list<string>::iterator iter = phrase.begin();...
  23. Replies
    5
    Views
    1,801

    I dont know anything about the template, but I...

    I dont know anything about the template, but I did get it off MSDN Software Alliance through my school.
  24. Replies
    9
    Views
    19,727

    It looks exactly like what I want, but for some...

    It looks exactly like what I want, but for some reason I am getting an error with this piece of code.



    for(list<string>::iterator iter = phrase.begin(); iter != phrase.back(); iter++){
    ...
  25. Replies
    9
    Views
    19,727

    How to get last element of list?

    Hello all, so I am trying to check for the last element in the list, but I don't know how. list.begin() is the first element, but list.end() is the one past the last element. Doing list.end()--...
Results 1 to 25 of 110
Page 1 of 5 1 2 3 4