Answer:
The answer to the given question can be given as:
The value of *iptr is 7. and the value of iptr is dynamic.
Explanation:
In the c++ code, it is defined that x is an integer variable that assigns a value which is 7. Then we define a pointer variable that is *iptr. This variable holds an address of the x variable. When we print the value of the iptr variable. if we use the expression *iptr to print value of the pointer variable by cout that is used in c++ for pint values. so the value of the iptr is 7. If we use the expression iptr sent to cout so we show the address of the variable x. In the pointer, it manages the addresses of dynamically allocated so the address of the variable is changed on execution time.
Answer:
See Explaination
Explanation:
#include <iostream>
#include <string.h>
using namespace std;
char *mixem(char *s1, char *s2);
int main() {
cout << mixem("abc", "123") << endl;
cout << mixem("def", "456") << endl;
return 0;
}
char *mixem(char *s1, char *s2) {
char *result = new char[1 + strlen(s1) + strlen(s2)];
char *p1 = s1;
char *p2 = s2;
char *p = result;
while (*p1 || *p2) {
if (*p1) {
*p = *p1;
p1++;
p++;
}
if (*p2) {
*p = *p2;
p2++;
p++;
}
}
*p = '\0';
return result;
}
Answer:
Artificial Intelligence (AI) is the branch of computer sciences that emphasizes the development of intelligence machines, thinking and working like humans. For example, speech recognition, problem-solving, learning and planning.