Is there a way to assign values in an array of arrays? Specifically, I have written the following code: The statement **A=i inside the function, s ...
Is there a way to assign values in an array of arrays? Specifically, I have written the following code: The statement **A=i inside the function, s ...
main.c:27:21: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘int **’ [-Wformat=] main.c:41:21: warning: format ‘%d’ ...
In C, suppose for a pointer p we do *p++ = 0. If p points to an int variable, is this defined behavior? You can do arithmetic resulting in pointing o ...
I am a beginner programmer and I'm having trouble with this task. I have to write a function that checks if the digits in the given string are strictl ...
Do you know why the output of the program below is I am very grateful if you can help me! Here is the program. int main() { int t[] = { 1, 2 } ...
I want to print the data of array by using pointers so I try to save the address of array in the pointer. But the pointer doesn't print the data. I wi ...
This is the program I have written: I'm trying this: The function squareVec is to square all entries of a vector. (-1, 2, 0) is to become (1, 4, 0) ...
Can someone explain this for loop to me? Mostly I'm asking about the for loop What does assigning the pointer p to ptable.proc do? And how do I ...
So I'm writing a program for an assignment that multiplies two matrices using dynamic arrays only. I'm running into two problems. I can't figure out h ...
So, i have to make a function that takes a 2d array as parameter with a pointer, specifically, so that cant be changed. This function that i wrote wo ...
I was trying to make a to dimensional array using malloc But when I tried compiling the file using ' gcc *.c -g -fsanitize=address (file_name)' this s ...
I have couple of snippets: Similarly this snippet: It outputs: But since pointer size is 8 bytes, and as every member of this array is pointe ...
p = adress of a variable. *p = The value in that adress. I understand this but why p is memory adress but p[x] isn't? For example if p = 987654321, ...
Could you please explain why we got a different result when we did (char *) casting? I compiled the code and found that the addresses are the same ...
Output: Why does the char pointer increment by one byte only? Its size is 8, right? When ptr is declared, the compiler allocates 8 bytes to it. W ...
I am a student who will be a freshman in an university after this summer vacation.I want to learn about computer programing in advance but I run into ...
Hi. In above code as per my understanding ,*(arr+1)[1] is equivalent to *(*(arr+sizeof(1D array)*1)+sizeof(short)*1)=>arr[1][1] i.e 14. But the p ...
std::vector is generally considered to be unimplementable pre-C++20 (as discussed in P0593), as the elements cannot be placed in an internal array whi ...
Why do I receive a warning? pch is already the pointer I got and when I want to subtract the addresses I use &Origi for that. C4047 '-' : 'cha ...