Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
2 votes
2 answers
80 views

I am trying to sort the values in the Data array into Column arrays X1,X2, and Y_actual. The code I have written out makes sense to me, and returns the correct array1,array2, and array3 values if I ...
Jackatoe's user avatar
0 votes
1 answer
127 views

Python programmer here. I know just the basics about C but I was given the task of taking n entries in an array then creating a function that takes an array pointer as its argument, and then accessing ...
Sarthak Katiyar's user avatar
-1 votes
1 answer
100 views

Although I've learned and worked with many advanced languages, but today when I was refreshing my C skills this old question again striked me. When we talk about pointers in C, simple pointers are ...
Shashvat Gupta's user avatar
0 votes
0 answers
39 views

Is the address of the first element of the array and the address of the array name pointer is same in C programming? And what if we create a pointer(p) to the first element(a[0]) of the array(a[5]) ...
Mohd Saq's user avatar
2 votes
0 answers
121 views

I have this PHP code: $array = [1, 2, 3]; $counter = 0; foreach($array as &$elem){ test(); $counter++; if($counter >= 10){ return; } } function test(){ global $...
Anorionil's user avatar
  • 505
0 votes
1 answer
30 views

phonebook is an array of pointers. inside the handleMenu im allocating memory and pointing to structure where a first name is assigned to a struct that is pointed from phonebook[11]. as you can see ...
olmervii's user avatar
0 votes
0 answers
50 views

EDIT: Pasting portion of code that is giving me this issue. Although in my effort to cleanup some of the comments before pasting it here I ended up with a different error. Still happens in the same ...
user20259078's user avatar
0 votes
1 answer
223 views

Reading cppreference I found this example: int a[4] = {1, 2, 3, 4}; int* p = &a[2]; std::cout << p[1] << p[-1] << 1[p] << (-1)[p] << '\n'; // 4242 I am confused ...
yrom1's user avatar
  • 27
0 votes
2 answers
213 views

Given a pointer-to-array in C, can we malloc to it enough memory for extra elements (beyond the specified array size) and then safely access those elements using either the [] operator or pointer ...
Jackson Allan's user avatar
1 vote
2 answers
3k views

I don't understand this C26485 warning I receive. My code is an exception handler: catch (CDBException* e) { TCHAR szError[_MAX_PATH]; e->GetErrorMessage(szError, _MAX_PATH); ...
Andrew Truckle's user avatar
1 vote
0 answers
45 views

I was going through array using pointers and I found two different dynamic allocation methods of an array int *ptr_arr=new int[10]; This one was defined in the lectures but when I explored a bit I ...
Priyanshu's user avatar
2 votes
2 answers
208 views

I know that using type alias and typedef make the code so readable, less error-prone and easy modify. However in this example I want to know this complicated type: #include <iostream> #include &...
Itachi Uchiwa's user avatar
1 vote
1 answer
218 views

As a newbie, I'm solving a problem from K&R's pointers chapter and was confused with some aspects of character pointers, and passing an array of type char* as a function parameter. Char array ...
UKS's user avatar
  • 13
2 votes
2 answers
151 views

I would like to concatenate two string with memcpy. But next memcpy is not working. My expected output is "my name is khan". #include <stdio.h> #include <stdlib.h> #include <...
Hemjal's user avatar
  • 337
0 votes
1 answer
69 views

i have this main and 2 more functions each on different file /*decleration of the functions on one file*/ typedef double *mat[4][4]; void catcher(void *,mat *); void findMat(mat *,char *,int *); int ...
Roy Shiff's user avatar
0 votes
1 answer
67 views

I need to do something like this: sizeof(int[width][height][8]) but unfortunately in c89 (the standard i have to use) this notation is forbidden, is there any way to do the same thing but using ...
Enrico's user avatar
  • 104
1 vote
1 answer
60 views

I am trying to work with threads in C. I need one of my threads to work on one half of a whole array, and mergesort its half. To do this I created a global array pointer for the whole array and both ...
R. Row's user avatar
  • 19
0 votes
2 answers
193 views

How to shrink an array if two consecutive numbers in an array are equal then remove one and increment other Example 1: int a[6]={2,2,3,4,4,4}; // Output: 6 Example 2: int b[7]={1,2,2,2,4,2,4}; // ...
Jahnavi Dunaka's user avatar
0 votes
1 answer
68 views

I am doing convolution operation for image. I have a problem in data stored in array pointer dynamically. The data in one of the array pointer variable is getting changed automatically after fopen ...
shabarish pr's user avatar
0 votes
2 answers
63 views

I need to know when the pointer went through the whole array -> is on the first position behind it. Examplecode in c: unsigned int ar[10]; char *pointer = (char*) ar; while(pointer != (char*) &...
Nemora's user avatar
  • 13
1 vote
3 answers
100 views

I am having troubles with the following code: int a[] = {1, 2, 3, 4}; fprintf(stdout, "a : %lu\n" "*a : %d\n" "&a : %ld\n" ...
anbocode's user avatar