lists and arrays in VBA

You will have to change some of your data types but the basics of what you just posted could be converted to something similar to this given the data types I used may not be accurate. Collections cannot be sorted so if you need to sort data you will probably want to use an array. … Read more

Delete 2D array C++

delete [] *M; is the same as delete [] M[0], so it is not equivalent to deleting all M[i] in a loop because only the first one would be deleted. The loop is the correct way to avoid memory leaks. Or better, use std::vector instead of manual allocations and you won’t need to worry about deleting pointers.

How to clear all the elements of array in C?

Your use of strlen() is wrong, that is reliant on the contents of the buffer being a valid string; it doesn’t clear the entire buffer. Just use memset() with sizeof: Note that sizeof is not a function, so no parentheses are needed (or should be used, in my opinion) for cases like these. If your C library doesn’t include memset(), a plain loop … Read more

How to print a char array in C through printf?

The code posted is incorrect: a_static and b_static should be defined as arrays. There are two ways to correct the code: you can add null terminators to make these arrays proper C strings: Alternately, printf can print the contents of an array that is not null terminated using the precision field: The precision given after the . specifies the maximum number of characters … Read more

How can I check whether an array is null / empty?

There’s a key difference between a null array and an empty array. This is a test for null. “Empty” here has no official meaning. I’m choosing to define empty as having 0 elements: An alternative definition of “empty” is if all the elements are null: or

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)