This code is giving me an error.I am new to pointers.Which part of the string will the pointer tell the memory address ofand why is this code wrong.
#include<iostream>
using namespace std;
void main(){
char char1[13];
char *pointer ;
pointer=&char1[13];
*pointer="qwertyuiopas";//there is error here
first of, you're using voidint() {}, my compiler doesn't accept it. it's C, not C++.
I don't know about C but in C++, array names are constant pointers, so you don't need to use address of (&) operator.
also,
as far as I know, you can not assign values directly (except for using cin or other console inputs). you should use something like strcpy().
At this point in your code, *pointer is referring only to char1[0], which can only hold one character. You are trying to input a string of characters into a one byte cell.