Search:

Type: Posts; User: Cpro

Page 1 of 6 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    1,047

    Find characters in a string

    *edit*
    Nevermind, it looks like I just needed to add a backslash:


    found = str.find("\\n");

    ----------------------------
    I'm searching for a sequence of characters in a string. I figured...
  2. Replies
    3
    Views
    2,602

    That fixed it. I guess I still had it set to the...

    That fixed it. I guess I still had it set to the Unicode setting when I added the astrisk the first time.

    Thanks for your help.
  3. Replies
    3
    Views
    2,602

    FindFirstFile trouble

    Hi. I'm trying to access the file names of all the files in a folder. I am trying to use FindFirstFile to do this. However, I'm having some issues.



    void TestFunction()
    {
    string...
  4. Replies
    10
    Views
    1,573

    Perhaps, but maybe it was wanting the reader to...

    Perhaps, but maybe it was wanting the reader to actually implement that part themselves; who knows.
  5. Replies
    7
    Views
    1,298

    ... input>>word; cout

    ...
    input>>word;
    cout<<word<<endl;
    input.clear();
    input.close();
    input.open("meaning.txt");
    ...


    Try adding input.clear(); This should fix the problem. This kind of explains it, although,...
  6. Replies
    10
    Views
    1,573

    Well, you are already prompting the user for more...

    Well, you are already prompting the user for more information; you just need to write it to the end of the file.
    Here is how I wold go about it:
    Move the for loop out of the while loop (if you...
  7. Replies
    10
    Views
    1,573

    #include "stdafx.h" #include ...

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

    int main() {
    int c; // input character
    int i; // loop counter
    char filename[81];
    char...
  8. Replies
    3
    Views
    1,246

    #include using namespace std; ...

    #include <iostream>
    using namespace std;

    double payRate;
    int hours;

    class Employee
    {
    public:
    void set(double payRate, int hours);
  9. Replies
    18
    Views
    4,016

    Just ask the user after the string is filled,...

    Just ask the user after the string is filled, right before the next key iteration (where my comment is). If it is the correct string, break from the for loop. Then the return statement executes,...
  10. Replies
    2
    Views
    11,014

    After the function definitions... Function...

    After the function definitions...


    Function calls...


    It looks like most of the work is done, and you just have to call the functions. I suspect these functions were already provided for you,...
  11. Replies
    18
    Views
    4,016

    The following works for me ("number" is the key...

    The following works for me ("number" is the key value and is set to 2):


    #include <iostream>
    #include <vector>
    #include <cstdlib>
    #include <string>
    #include <fstream>

    using namespace std;
  12. Replies
    18
    Views
    4,016

    What exactly are you trying to do with the key...

    What exactly are you trying to do with the key loop? The program should be working now.

    A couple things:
    -Some of your plus & minus symbols in the for loop are switched around.
    -You have no if...
  13. Replies
    18
    Views
    4,016

    Ah, I think I understand now. So, when it hits...

    Ah, I think I understand now. So, when it hits 127, it is suppose to go back to 32 and add what was left over. In that case, your if statement is justified:


    if (int(encrypted[i]) + key > 126)
    ...
  14. I'm not sure that makes sense. Could you please...

    I'm not sure that makes sense. Could you please clarify.
  15. Replies
    18
    Views
    4,016

    string decode(vector encrypted, int key) ...

    string decode(vector <char> encrypted, int key)
    {
    string decode;
    int size = encrypted.size(), i = 0;
    for (i; i < size; i++) {
    for (key = 0; key < 100;...
  16. Replies
    3
    Views
    5,991

    It believe it should look like the following: ...

    It believe it should look like the following:



    #include <iostream>
    #include <string>
    using namespace std;

    struct car
    {
  17. Replies
    11
    Views
    2,976

    int TimesShoot; cin>>TimesShoot; float...

    int TimesShoot;
    cin>>TimesShoot;
    float avgarray[TimesShoot];


    How is this possible? I didn't think an array could be created like that, since TimesShoot is not a const.
    I thought you had to do...
  18. Replies
    2
    Views
    2,190

    if(ball_y

    if(ball_y <= 0){
    if(ball_direction == 2){
    ball_direction == 3;
    }
    if(ball_direction == 5){
    ball_direction = 6;
    }
    }
  19. Replies
    2
    Views
    1,083

    Are you having the issue only when you are in the...

    Are you having the issue only when you are in the game or always?
    I'm assuming the touchpad has a separate driver associated with it (mine does). You could try updating/re-installing it. I doubt it...
  20. Replies
    5
    Views
    2,631

    The method BuzzBuzz suggested is probably the...

    The method BuzzBuzz suggested is probably the best way to go about it. But, just to give you another option...
    You could have the word stored in an array, and compare the characters until all have...
  21. Replies
    7
    Views
    10,891

    How does "cin >>" not accept ","? Example: ...

    How does "cin >>" not accept ","?
    Example:


    cout << "Please enter your name (last, first): " << endl;
    cin >> lastName;
    cin >> firstName;

    cout << lastName;
  22. Replies
    1
    Views
    1,144

    Could you further explain what you mean by adding...

    Could you further explain what you mean by adding a counter. Are you just wanting to time how long the program ran or something else?
    Also, what specific problems are you having implementing it?
  23. Replies
    7
    Views
    10,891

    The comma after the last name is what makes it a...

    The comma after the last name is what makes it a bit more difficult. If there was no comma (just a space), you could just do:



    cin >> lastName;
    cin >> firstName;

    cout << firstName << " " <<...
  24. Thread: Table Help

    by Cpro
    Replies
    1
    Views
    883

    Perhaps you could use a two dimensional vector,...

    Perhaps you could use a two dimensional vector, using a struct to hold different types of data.
  25. Replies
    11
    Views
    10,180

    "but im a bit confused about how to get...

    "but im a bit confused about how to get Count_space.fail() worked in?"

    Well, you don't have to use it. It just depends on how you make your while loop. This is how I did it:



    while(1)
    {
    ...
Results 1 to 25 of 149
Page 1 of 6 1 2 3 4