Oops, I thought only letters have ascii values. Now it is going to be more complicated. Thank you!
Type: Posts; User: Roy01
Oops, I thought only letters have ascii values. Now it is going to be more complicated. Thank you!
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...
That's exactly what I want! Thank you so much!
Thanks, these are quite useful for me.
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...
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...
Thanks, I always forget this. :D
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...
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...
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.
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...
Thank you for your clear explanation, I got it.
This is the code I saw in mock paper.
struct Ant
{
int age, strength;
};
int n;
cin >> n;
Ant *AntArmy;
Thx!
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?
There is no syntax error here:
#include <iostream>
#include <stdlib.h>
#include <string>
using namespace std;
class A
{
public:
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.
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))//...
Thx!I thought it would be going more complicated.lol
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...
Thx!
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;...
Thank you, Ken.
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...
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...