As a beginner when to use built-in functions and when to write those myself?
What are ALL of the basic functions in C (without libraries)
What are some common PHP built-in functions you have to google even though you use them constantly?
Attending my first matlab class . What are the things I should remember ?
Hi!
I've been learning Python at school, but at home I've taken more and more interest in learning C++. I have no clue why, but cpp is just more stimulating.
At school we've been learning about different concepts (?) at a very basic introductory level in Python (enumerate, matrixes/2d arrays, dictionaries, functions), and I've been "translating" or trying to find an equivalent of those in cpp to get familiar with the syntax and how the language works.
So my question is it better for me as a beginner to use the built-in functions offered by languages in general, or should I write them myself. For example
How should I get the largest int from a list?
list = [112, 23, 3, 4, 54]
def biggest_int(input_list):
maximum = input_list[0]
for number in list:
if number > maximum:
maximum = number
return maximumOR
print(max(list))
what I've done in cpp:
#include <vector>
std::vector<int> numbers = {1, 2, 4, 58, 68, 23, 45, 56};
int maximum = numbers[0];for (int number : numbers) { if (number > maximum) { maximum = number; } }
or
return *std::max_element(numbers.begin(), numbers.end());
I know these are not 1:1 translations or exactly the same methods/versions, but I think these demonstrate what I am trying to ask
Thanks in advance, and please tell me if the question isn't clear enough.