Relative Content

Tag Archive for arraysc

dealing with array of arrays in c function

I struggling with understanding how to reach the data inside array of arrays.
I have an array of size n where each element is an array of size 2 so it looks like this:
[[0,1],[0,2],…,].
This array is passed to a function as
function(int** arr, int n, int* arrColSize)
How can I do a compare on the arrays inside the array?
for example I want to do something like
if (arr[0] == [0,1]))
Here it should return true

Is it possible to define multidimensional arrays from user input in C? [duplicate]

This question already has answers here: How can i create an n-dimensional array in c (2 answers) Correctly allocating multi-dimensional arrays (3 answers) Closed 23 hours ago. Is it possible to define multidimensional arrays from user input in C where the user could specify the number of dimensions, eg: 1 => arr[x] 2 => arr[x][x] […]

How to avoid stack smashing detected in C? What is wrong with the code below?

I’m making a program which automates Luhn’s algorithm; it takes every other number of a credit card starting with the first one, multiplies them by two, and adds the multiplied the added numbers together. I’ve not finished, but have encountered a problem called “stack smashing detected”. Can anybody offer help or advice?

How to compare an integer to an array?

I am doing a Registration code in C, which basically can input multiple accounts.
Now, what I want is to access that specific account through a Log-In function where (Pass == LogIn Pass).