& can bit change. & is also used for access and output of a memory address.
using "&&" is for logical statements.
1 2 3 4 5 6 7 8
if (r == 8 && r2 ==9)
// then do statement(s) here. if more than one statement below if, use braces
if (r == 8 && r2 == 9)
{
// 1st statement
// 2nd statement ...
}
Bitwise AND
The bitwise AND operator is a single ampersand: &. A handy mnemonic is
that the small version of the boolean AND, &&, works on smaller pieces (bits
instead of bytes, chars, integers, etc). In essence, a binary AND simply takes
the logical AND of the bits in each position of a number in binary form.
#include <stdio.h>
int main(void)
{
unsignedint a = 1, b = 2, c = 3;
printf("the memory address of a is 0x%x\n", &a);
printf("the memory address of b is 0x%x\n", &b);
printf("the memory address of c is 0x%x\n", &c);
return 0;
}
cpp.sh complains about a pointer is what looks like, the memory address display ok.
Line 2 shows a function that takes a reference (identified by the '&') as an argument.
Line 5 shows the '&' taking the address of x being passed to a function taking a pointer as an argument.
Edit: Also, the '&' does not "display" anything, just provides access to the address of a variable.
& helps access memory address of variable. char or integer.
Why are you specifically limiting this to char and integer variables? & before the name of an object or variable signifies the address of (or a pointer to) that object, regardless what type it is.
i did not declare a limit. helps access char or integer. & may have other uses. happy
MikeyBoy is upset. look into reference section(s) to see what other uses "&" may have.
there are a couple program examples above. how "&" is used for bits and hex memory address output.
responding:
who are you replying to zhuge?
int, char, string. typical data types. i did not mention float data type "0.00"
these pages for reading:
http://www.cplusplus.com/doc/tutorial/variables/
http://www.cprogramming.com/tutorial/c/lesson1.html
http://www.cprogramming.com/tutorial/lesson1.html
You should be more clear with what you are writing; unclear information can be highly detrimental when you are trying to answer someone's question. All your posts in this topic seem very hastily written and not well thought out, with only the most basic understanding of what you are saying evident. If English isn't your native language, I would politely request that you spend more time editing your work before posting it to improve readability and prevent these misunderstandings from occurring.