how to use if else statement in charecter type array(string)
my problem is how to use if else statement with the use of character type string (char str) for exemple
cin>>str; or gets(str) or getline(str,30)
i search this everywhere but every answer could not satisfied me.
on the left you have a pointer, and on the right you have a pointer. The value of a pointer is the number it holds; a single memory address. So the value on the left would be something like 0x0324FEED (a single number, representing an address) and the value on the right would be something like 0x03284EEA (a single number, representing an address). Those numbers (two memory addresses) are what is being compared.
So you are testing to see if both pointers are pointing at the same memory. Of course, they are not pointing at the same memory.
What you are trying to do is compare not the pointers, but what they are pointing at.
You could do this yourself (for example, with something like:
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...