Message from C, C++ talks

July 2019

— Yeah i=2,but why does it effect a[1]? i is just a variable right? why would assigning a variable effect array element?

Message permanent page

— Another one bites the dust...!
Banned Dan.
Reason:
Cryptocurrency ad

— Array is just a pointer, so when u increment arr[index] u increment array element, not it's copy

— Try to declare

const int arr[5] ... 

instead of
int arr[5] ...

for better understanding

— 

Okay... one more try

int arr[2] = {1, 2};
// u create actually a pointer (int *) named arr, it
//points to a
//memory-area with size sizeof(int) * 2;
int i = ++arr[0];
// here u just write this actually: int i = ++*(arr + 0);
// so u increment variable, that locate at 'arr + 0' address

— Well thanks! that explains 😁

— Another one bites the dust...!
Banned MINDAYS.

— Hi, i'm newbie

— Nohello.com

— Welcome

— That's 2/2 warnings; 𝓜𝔂 𝓞𝓻𝓰𝓪𝓷𝓲𝓬 𝓗𝓮𝓪𝓻𝓽 is out!
Reasons:
1: hacking
2: i want to use kali lunix os in my windows laptop how it is possible anybudy help..?

Message permanent page

— I ALWAYS get segmentation fault when i try to use 2D arrays or an array of strings. Any idea why?

— Show code

— Int main()
{
int ele,i,n,q;
int row,column;

cin>>n>>q;
int array[100][100];

for(i=0;i<n;i++)
{
cin>>ele;
for(int j=0;j<ele;j++)
{
cin>>array[i][j];
}
}
for(int k=0;k<q;k++)
{
cin>>row>>column;
cout<<array[row][column];
cout<<"\n";
}
return 0;
}

Message permanent page

— Its sort of a 2D array but number of elements in each row is not the same.. the number of elements is the first input in each line which i've taken as ele

Message permanent page