Search:

Type: Posts; User: hencherz

Search: Search took 0.01 seconds.

  1. Replies
    7
    Views
    954

    I'm having difficulty to understand that. You...

    I'm having difficulty to understand that.

    You say to use map<char,bool> but in the code presented it says man<char,bool> what does man stand for?

    "
    map_name_you_use" is this a name that I come...
  2. Replies
    7
    Views
    954

    Since its an actual assignment I won't be able to...

    Since its an actual assignment I won't be able to post all of it, I hope you understand..

    This is the actual part that I can't move from. There isn't a way that I know of to go back to the _'s to...
  3. Replies
    7
    Views
    954

    Hangman game - unmasking the letters.

    Hello again,

    I am trying to design a hangman game but I'm having an issue with trying to get to the next step from where I am.

    So far I am able to generate random words, get the program to...
  4. Replies
    6
    Views
    1,034

    I've created a for loop that will loop for every...

    I've created a for loop that will loop for every single character the user has entered.

    Lets say if the user has entered the word test, it will loop 3 times (just realised I should perhaps do a <=...
  5. Replies
    6
    Views
    1,034

    Fixed, but I still get 0% for each character..

    Fixed, but I still get 0% for each character..
  6. Thanks, but what does while(1) actually do here?

    Thanks, but what does while(1) actually do here?
  7. Replies
    6
    Views
    1,034

    Calculation problem with string

    I'm trying to work out the percentage of each letter in a string typed in by the user, it should display all characters followed by the % which will be worked out by the length of the string


    ...
  8. Thank you very much, it worked. :) Another...

    Thank you very much, it worked. :)

    Another quick question. What if I wanted to make the program restart, is there any way I can call main again instead of it quitting on me. i.e.




    if (z ==...
  9. Replies
    5
    Views
    1,556

    do { // carry out tasks }...

    do {

    // carry out tasks




    } while (!isupper(string));
  10. The address of Z? How do I go about doing that? ...

    The address of Z? How do I go about doing that?

    Do I need to declare a [0][0] or something?
  11. Variable being used without being initialised

    A simple program that asks the user to enter a or b, if a is entered, some text is displayed, and if b is entered then the program exits.



    #include <stdio.h>


    int main()
    {
    char z;
  12. Replies
    5
    Views
    1,556

    do while loop for chars

    I have created a program where by a user inputs a set of upper case characters and then the program carries out a set of tasks based on the input.

    What I'd like to know is how do I implement a do...
  13. Replies
    8
    Views
    3,532

    double array[5][2] = {{0, 4320.55}, {0, 32.77},...

    double array[5][2] = {{0, 4320.55}, {0, 32.77}, {0, 561.52}, {0,243.57}, {0,5479.16}};


    string cities[5] = {"NewYork", "Westbury", "NewJersey", "England", "Miami"}

    After reading the above...
  14. I see what you mean, I just put in one of the...

    I see what you mean, I just put in one of the vowels and the output incremented accordingly.

    I changed the double quotes to single but the compiler begins throwing errors at me..
    I know in C...
  15. Replies
    8
    Views
    3,532

    Thank you all for your suggestions. double...

    Thank you all for your suggestions.



    double array[5][2] = {[0][4320.55], [0][32.77], [0][561.52], [0][243.57], [0][5479.16]};
    string cities[5] = {"Newyork", "Westbury", "Newjersey", "England",...
  16. Sorry, got a mix up there, it is fixed now.

    Sorry, got a mix up there, it is fixed now.
  17. I am coding it so that it accepts lower case...

    I am coding it so that it accepts lower case vowels only at the moment, I can change that later but its good to go for the moment. :)


    @laserlight, here is my current code:



    #include...
  18. I now have a working code. :) Problem is when...

    I now have a working code. :)

    Problem is when I output the incremented array (its supposed to increment) I'm being told that all the vowels have occured 0 times when this is not the case?

    I've...
  19. Replies
    8
    Views
    3,532

    2D array of doubles

    I want to be able to store distances between cities using C++, and store these distances using an array of 2D double (data type). I then want to ask the user to enter two of these cities and output...
  20. Counting vowels in a string - invalid identifier

    This is just a small fragment of my code so I didn't include all the vowels.



    string response;
    int array [5]= {0, 0, 0, 0, 0};


    cout << "enter a string of text\n" << endl;
    ...
  21. Thanks! That fixed it, another thing I've learnt...

    Thanks! That fixed it, another thing I've learnt now. :)

    I've gone and implemented the code to update all counters of the alphabet, however all I've done now is print out the number assigned to...
  22. Thanks all, the data type change did sort the...

    Thanks all, the data type change did sort the problem out after all.. I'm now trying to print out the occurrence of a char typed in to the string..
    (I've spent some time trying to accomplish this...
  23. Printing out char elements in an array from user input

    First post on this website, I'm a newbie to C Programming. I've got my head around data types.

    I want to be able to ask the user to input a string of text and store it in an array. I have created...
Results 1 to 23 of 23