Search:

Type: Posts; User: Roy01

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    8
    Views
    9,691

    Oops, I thought only letters have ascii values....

    Oops, I thought only letters have ascii values. Now it is going to be more complicated. Thank you!
  2. Replies
    8
    Views
    9,691

    How about generating letters from ascii values?...

    How about generating letters from ascii values?
    This is the sample input & output


    Enter a word : abc
    Enter a number: 1
    The ciphered word: bcd

    What's wrong with my code?It can't get what I...
  3. Replies
    8
    Views
    9,691

    That's exactly what I want! Thank you so much!

    That's exactly what I want! Thank you so much!
  4. Replies
    7
    Views
    1,214

    Thanks, these are quite useful for me.

    Thanks, these are quite useful for me.
  5. Replies
    8
    Views
    9,691

    For example, if the ascii value of a and b is 0...

    For example, if the ascii value of a and b is 0 and 1, add 1 to the ascii value of a, then the character is changed from a to b.
    I know how to do it with array but it is clumsy.
    Is there any...
  6. Replies
    8
    Views
    9,691

    How to manipulate ascii value of letters?

    How to manipulate ascii value of letters?
    For example, if the ascii value of a and b is 0 and 1, add 1 to the ascii value of a, then the character is changed from a to b.
    I know how to do it with...
  7. Replies
    7
    Views
    1,214

    Thanks, I always forget this. :D

    Thanks, I always forget this. :D
  8. Replies
    7
    Views
    1,214

    Oops,I forgot to mention that, sorry. It should...

    Oops,I forgot to mention that, sorry.
    It should be reverse so x[1] should be 9 according to your example.
    If string can't be used, how to divide the integer into digits?
    I asked this question as...
  9. Replies
    7
    Views
    1,214

    Dynamic array question

    How to write functions to add 2 big integers with dynamic arrays?
    The 2 integers are input by users.
    2 integer arrays store the input such that :
    x[0]=number of digits
    x[1]=1 st digit of the...
  10. Thread: logic question

    by Roy01
    Replies
    5
    Views
    1,569

    Thanks! Actually the code is the suggested...

    Thanks! Actually the code is the suggested solution of the task. Maybe there is a mistake.I wonder if w=x; x=y; y=z; z=temp; should be moved after the cout statement.
  11. Thread: logic question

    by Roy01
    Replies
    5
    Views
    1,569

    logic question

    Suppose a file has a sequence of integers:1 2 3 4 5 6
    The following is the code. It should read all the integers and output averages of 4 integers until the file ends.
    The output should be
    2.5...
  12. Replies
    3
    Views
    1,160

    Thank you for your clear explanation, I got it.

    Thank you for your clear explanation, I got it.
  13. Replies
    3
    Views
    1,160

    problem on dynamic array

    This is the code I saw in mock paper.


    struct Ant
    {
    int age, strength;
    };
    int n;
    cin >> n;
    Ant *AntArmy;
  14. Replies
    5
    Views
    1,348

    Thx!

    Thx!
  15. Replies
    5
    Views
    1,348

    Oops, I often forget to add ; after }. Yes,...

    Oops, I often forget to add ; after }.

    Yes, there is input before calling get_input()
    I added cin.ignore();after each get_input(). I still get the unwanted output. How to avoid this?
  16. Replies
    5
    Views
    1,348

    problem of input in member function of class

    There is no syntax error here:


    #include <iostream>
    #include <stdlib.h>
    #include <string>
    using namespace std;
    class A
    {
    public:
  17. Replies
    6
    Views
    1,663

    Thank you for your detailed answers. At least I...

    Thank you for your detailed answers. At least I am more clear about when to use call by reference in class. It takes some time for me to digest. Thank you.
  18. Replies
    6
    Views
    1,663

    Question about concept of class

    I spent quite a lot of time to try to understand class but still not clear about the concept. Help me please.
    1. I saw something like this:


    bool class::mem_f(int x)
    {
    if (!(x%5))//...
  19. Replies
    3
    Views
    1,128

    Thx!I thought it would be going more...

    Thx!I thought it would be going more complicated.lol
  20. Replies
    3
    Views
    1,128

    Question about class

    I am stuck over these for hours. Plz help.

    1.There are 3 files here: fraction.h - class definition , fraction.cpp - member functions & main.cpp- main function. How to link fraction.cpp with...
  21. Replies
    3
    Views
    1,330

    Thx!

    Thx!
  22. Replies
    3
    Views
    1,330

    problem of class definition and main function

    Here, the class definition and the main function must be in the same file and the type of the main function must be void. It has 1 error & 1 warning:



    #include <iostream>
    using namespace std;...
  23. Replies
    6
    Views
    1,142

    Thank you, Ken.

    Thank you, Ken.
  24. Replies
    6
    Views
    1,142

    More basic question about string. My problem is...

    More basic question about string. My problem is here:


    #include <iostream>
    #include <stdlib.h>
    #include <string>
    using namespace std;
    void main()
    {
    string str='000-000-0000';//The compiler...
  25. Replies
    6
    Views
    1,142

    Thx! I need to convert part of a character array...

    Thx!
    I need to convert part of a character array into integer and am wondering how.
    How to convert string into integer ?
    How to convert string into content of a character array ?

    I ask these...
Results 1 to 25 of 50
Page 1 of 2 1 2