Anonymous
FILE *comArgs = fopen( *argv, "r");
Anonymous
can i do something like this
Anonymous
create a data stream that reads from command line arguments ?
Anonymous
anyone here ?
klimi
I'm sleeping but here
Anonymous
I'm sleeping but here
for(count = 0;count <= argc;count++){ arrayI[count] = atoi(argv[count]); }
Anonymous
i am trying to set command arguments and add them as elements to any array
Anonymous
convert them to int , then send each value to an array
Anonymous
so lets say i do ./a.out 1 2 3
Anonymous
array[100] = { 1, 2, 3}
Anonymous
would be the value of the array
Pete
Alright guys do you have a preffered method to get execution times?
Pete
I've been using this but my times are becoming too similar lately and its not giving me distinction anymore
Pete
#include <chrono> //start auto started = std::chrono::high_resolution_clock::now(); //code auto done = std::chrono::high_resolution_clock::now(); cout << "Execution Time: "; std::cout << std::chrono::duration_cast<std::chrono::milliseconds>(done - started).count() << " ms" << endl;
Ilya
My openmp based program is only using 1 thread on my laptop. Do I need any other configurations/environment for multiple threads to work ?
Look for a special group/channel on OMP, this technic is really very rarely used, nobody knows it except people serialized in it
Ilya
Hi, I’m working on this basic c program and I am stuck. Data validation function is not working properly. Any help would be much appreciated : https://gist.github.com/wilfrantz/5c39fd075f34fd2903f6dca5d7df2352
It is very bad idea in C to pass a structure to a function by value, like you do. Here it is doubly so because you need output parameter from the function. If you pass structure by value, you copy it and only the copy gets modified.
Ilya
i am trying to take the arugments from command like , put in a for loop to store the values in an array
You'd Better use ready to use commands line parser libraries, like getoption, boost programm option and others, there are many of them
Artöm
And i dont need it as out arg
Cold
which language i should start with ....? 🤔
Artöm
which language i should start with ....? 🤔
Have you seen chat name? What answer do you expect?
Artöm
C++ then. At least 11
Artöm
With vector being introduced asap
Rohan
can anyone tell me " how to get bold text output in console ??"
Rohan
in C programming
Artöm
Linux?
Artöm
He can use os specific console escape sequences
Artöm
Impossible in C itself
Pete
Theoretically for quick sort is median for partition the best time complexity?
Pete
Randomization only makes the worst case rare correct?
olli
Is it also bad if sizeof(struct M) <= sizeof(void*) ?
it's always best to measure your performance, if it's a const input (no modifications) and smaller than a pointer it's a good idea to pass it by value. I'd even argue slighly bigger values (16 bytes) could benefit as well since you don't have the pointer indirection.
Talula
WTF? I didn’t type this Yes
Talula
Trolling?
Talula
/report fake copy
Talula
@Taj567 is a troll and he is so mean he has my son’s picture…
Talula
/report @Taj567
Anonymous
This group is weird
Talula
You still didn’t delete my Bio… it’s not a bug.
Talula
@ollirz help here please… these trolls are being jerks.
Anonymous
Anonymous
who r u???
Ilya
in C programming
Use lib NCurses
Anonymous
@ollirz help here please… these trolls are being jerks.
/report trying to hack my bio with scream shots
András
Python
Nah. Start with language with dynamic typing is very bad idea
Talula
@unterumarmung Help please…
András
which language i should start with ....? 🤔
As for me, the best first language is pascal. Seriously, firstly you need to understand the program logic, and there is no extra information, that you need to consider in pascal, so in pascal you learn only program logic, nothing more. So try to write some program in pascal for a week, and that use more powerful language
Talula
Language depends on what you want to do.
András
Besides, learning Pascal is impractical. It is not used in production
Yeah, but you should understand simple logic of your code, and in more modern languages you need to understand more things to write the same simple code
Talula
I’m a pascal programmer… I use pascal to program most of my personal projects, I use Lazarus… but I wouldn’t recommend pascal to anyone because it’s PAIN.
András
Language depends on what you want to do.
Beginner rarely know what he wants to do
András
It depends on the code, with Python you can write code simply.
And take runtime errors and don't know what is the reasons
Talula
It depends on the code, with Python you can write code simply.
At the same time Python is limited, it can’t do everything and whatever it can do is actually pretty ugly.
Talula
For a starter I would recommend JavaScript.
aselectronics
Hello all
Talula
Hi
aselectronics
Hi Tazz , I'm new to electronics
aselectronics
Which language is best to learn , for electronics programming
András
For a starter I would recommend JavaScript.
No-no-no-no, it is the bad idea. Beginner won't understand why const a = { A:5 }; const b ={ A:5 }; a==b;//false
aselectronics
C or python
András
C or python
C without pointers may be
aselectronics
Thanks Andras
Ilya
Beginner rarely know what he wants to do
Just because of this, learning Pascal is a completely crazy idea, if the newbie learns Python , or say Java or say even PHP or Visual Basic he or she gets some theoretical knowledge to be introduced to programming in general and some practical skill of the particular programming language. If he or she learns Pascal, he or she just walk into the forest just for learning how to walk. There is no guaranty they will be able to find way out.
aselectronics
Which method is best way to learn , udemy courses or