mj12
Why even go to the lengths of making one driver that handles all of those devices?
Wouldn't it make more sense to create smaller modules where you can just load the ones you're interested in, so you don't even have to handle cases that can never happen?
Elil 50
Do you know how to solve? https://stackoverflow.com/questions/74670725/c-libraries-in-python-initializing-pseudo-random-generator-seed-each-time-in
Anonymous
hi, who can help me?
Anonymous
hi, please help me curl_easy_setopt(curl, CURLOPT_URL, "example/ip=%d&port=%d&time=%d", argv[1], argv[2], argv[3]); error: macro "curl_easy_setopt" passed 6 arguments, but takes just 3
Anonymous
so you can help me with my problem?
Edy
But program doesn’t work
The program works... But nothing appears to the screen... Check how the Cout function works
🇺🇸
The program works... But nothing appears to the screen... Check how the Cout function works
In my version of c++ name function has already possessed by other ones so I needed to add std::
Edy
Correct
🇺🇸
Correct
Thanks 😅
Persia
Guys do you know any good lessons for learning c++? From zero to advanced
Sarmat
When i bulding assimp library to android i have this error, NDK is broken, or what? E:/C++/assimp/tools/NDK/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1\fstream:952:20: error: use of undeclared identifier 'ftello'; did you mean 'ftell'? pos_type __r = ftello(__file_); ^ E:/C++/assimp/tools/NDK/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1\cstdio:141:9: note: 'ftell' declared here using ::ftell; ^ 1 error generated. mingw32-make[2]: *** [code\CMakeFiles\assimp.dir\build.make:159: code/CMakeFiles/assimp.dir/Common/ImporterRegistry.cpp.o] Error 1 mingw32-make[1]: *** [CMakeFiles\Makefile2:159: code/CMakeFiles/assimp.dir/all] Error 2 mingw32-make: *** [Makefile:135: all] Error 2
Marshall
Is it possible to save a histogram to a folder in my pc without plotting it? (Im using matlab)
Marshall
no, you cannot save something that doesn't exist
I "solved" it. The thing was that i had to create 1816 histograms but plotting all them was just crazy. But i added set(gcf, 'visible', 'off');
klimi
you plot it and then save it?
Marshall
Without that line i ended up having 1816 open windows and my pc was crashing. But doing it this way it "overwrites" every figure
Thadeu
It is easy to provide a kind of polymorphism in C using the combination of macros + functions receiving void * values. These macros can act as truly functions when its results are encapsulated with parenthesis and with an specie of return created with comparison operators. These combos (macro+void parameterized functions) avoids the excessive usage of inlining and the functions can be present as static (with guards agains recurrent including) and easy portable. A full C library of tools can be built this way for many kinds of algorithms. The question is... as it is simple, if well tested (against memory problems), there is some other downside?
Anupam2.7
c and c++ are considered as high or low level programing language? I have already googled and got some mix answer.
Nomid Íkorni-Sciurus
c and c++ are considered as high or low level programing language? I have already googled and got some mix answer.
"high" or "low" don't make sense nowadays. what it means to be "low" is to be able to speak machine-level code that is, nothing other than assembly variants or machine code will be considered "low".
Jose
c and c++ are considered as high or low level programing language? I have already googled and got some mix answer.
C is considered "low/medium level". You can use ASM, you can create programs mixing asm and C code (even APIs). C++, in the other hand...
Nomid Íkorni-Sciurus
Though, for what it matters, C was born as an "abstraction layer" of assembly so it COULD have been considered "low" in older versions like C89 but it's just a matter of technical details.
kww
bro was just asking but still got mixed answers
Nomid Íkorni-Sciurus
bro was just asking but still got mixed answers
the concept of "low" or "high" doesn't make sense nowadays this is not a mixed answer rather, kind of a demonstration of how we usually misuse / mistell stuff.
Anupam2.7
Thanks
Thadeu
c and c++ are considered as high or low level programing language? I have already googled and got some mix answer.
It is relative. lower is nearly to the eletrical signal passed to machine, higher is in relation to abstraction (in human or mathematical language). So assembly is high compared to the way eletrical signals are emitted. To an assembly coder, C is high level. To a C programmer assembly is low and Python is high level. To a Java programmer C is low. Someone still can argue that JS is higher than Java as JS is dynamically typed and so on... Usually high levels contains abstractions but also "sugar" and are less performant, just because the compilation, transpilation or interpretation process of code make assumptions to avoid mistakes and who program in higher level languages can't deal with the resulted lower level result.
Iwan
c and c++ are considered as high or low level programing language? I have already googled and got some mix answer.
The only low level language is assembly because is about architechture programming, you cannot run ARM assembly on your x8664 machine. Different from assembly, C programming still can used in every different architechture. But, C can write an assembly code (inline). Thats why C is the middle one between low and high level language.
Yari
I'm trying to develop a program that solves Sudoku grids using recursion and backtracking. I'm not having the desired result, can you correct me?
Nomid Íkorni-Sciurus
language compilers that rely on meta-machine wizardry like .NET (CLR/IL), the GCC suite (C--) and LLVM don't necessarily clog the output binary in terms of memory
Nomid Íkorni-Sciurus
this is a thing in the moment you understand compiler attributes and how to write efficient multicore code
Nomid Íkorni-Sciurus
What I mean by «the concept of "high" and "low" does not make sense» is that contextually, a programmer will 99.99% never, nowadays, write plain opcode/machine code or even assembly
Nomid Íkorni-Sciurus
Though consider that "Assembly" itself is not a language but rather a family of very different languages that do not even necessarily map 1:1 to machine opcodes
Nomid Íkorni-Sciurus
so, stating that "C is higher level than Assembly is" is not true for every language in the Assembly family
Nomid Íkorni-Sciurus
If you wrote a JS frontend for LLVM, it would still compile down to executable machine code (which actually, already happens JIT in your browser)
Nomid Íkorni-Sciurus
so the statement "higher level language are less performant" is just false
Nomid Íkorni-Sciurus
as they always say, there is just "bad code" or "decent code"
Nomid Íkorni-Sciurus
and all of this applies... unless you're speaking of interpreted languages which tend to be slower/less efficient because of the specific overhead caused by their interpreters (e.g. Ruby or Python or such) though this is not a rule of thumb.
Thadeu
so the statement "higher level language are less performant" is just false
1. I told a way to understand what is high and low: the way of abstraction. A high is not always fast and not always performant, due to sugarization and abstraction. Some "simple" code people write, by example, using an insertion in array. If it is not pushed it is mem moved. Due to sugarization, some language (or pattern) may always add a test to decide if memmove or not. It is a short example to illustrate that the abstraction hidden what is done, sometimes requiring more work that needed and leading to more memory/cycle comsumption. Even JIT may suffer this way from sugarization.
Nomid Íkorni-Sciurus
indeed, I didn't consider this detail
Nomid Íkorni-Sciurus
okay, I see your point
M
What's this line mean ? char *aaa[] Is it array or string?
hrb
int str_equal(char* str1, char * str2) { while(*str1==*str2) { str1++; str2++; } if (*str1 == '\0' && *str2 == '\0') { printf("%d\n", 1); return 1; } else { printf("%d\n", 0); return 0; } }
hrb
i have this code its supposed to return 1 if two strings are identical and 0 if they are not
M
When I use it uninitialized it will occur error, But when I use it in struct error will dispear How is it ?
hrb
its not working 😐
M
And is there any difference if I use size on bracket or leave it empty ?
M
And is there any difference if I use size on bracket or leave it empty ?
I ask because when I used malloc and push it on this arr without size and other place ftee it , it will cause error with Segmentation fault But with size , it works .
Anupam2.7
Why do we prefer writing recursive function over looping(in DSA) while both of them are havin same time complexity? For eg. The program of factorial in recursive and loopong both take O(n) time.
Anonymous
I find it useful to know how problems are solved in different languages. That gives me perspective and results in better code I think.
Anonymous
this group is amazing. Can't you teach me how to make a complex calculator?
Toxirov Sherzod
Hi. Who knows how to print symmetric triangle shape in c++
Anonymous
Do you have a manual book about C++.
Anonymous
C Programming Absolute Beginner's Guide 3rd Edition by Greg Perry
Anonymous
Use this book and remember to practice a lot.
Gregory
Do you have a manual book about C++.
Check my profile , maybe you have answer
Yeerriinn_
hi guys, i have a question. i have to build a program to find the x intercept using bisection method. One of the function is (1/7 + 1/x) and it gives the wrong x-intercept. But when i write the function as (1.0/7 + 1/x), the intercept is correct. Does anyone know why it should be 1.0 and not only 1?
Yeerriinn_
yes, i set it to double by the way
Yeerriinn_
what is bodmas rule?
PIZZA
what is bodmas rule?
it's a mathematic rules to gives the multiple operators priority in a equation
Yeerriinn_
ah i see. so if i write it (1/7)+ (1/x)= it will do 1/7 first then + (1/x) or it will +1 first then divide by x?
Kishore
H
SirCourage
PLS I need assistance
SirCourage
Loan negotiation is usually not a straightforward task. A type of loan is the discount installment loan. This type of loan has the following characteristics. Supposing a loan has a face value of GHC 1000, interest is 12% and the duration is 24 months. The interest is compounded by multiplying the face value by 0.12 to produce GHC 120. The figure (120) is then multiplied by the loan period of 2 years to give GHC 240 as the total interest owed. This amount is immediately deducted from the face value leaving the customer with only GHC 760. Repayment is then made in monthly equal installments based on the face value. This means that the monthly payment will be GHC 1000 divided by 24 which is approximately 41.67. This method of calculating the monthly repayment is not too bad if the consumer needs only GHC 760 but the calculation is a bit complicated if the consumer needs GHC 1000. a. Write a program that will take 3 inputs 1. The amount the consumer needs 2. The interest rate 3. The duration of the loan in months. b. The program should then calculate the face value required for the consumer to receive the amount needed. c. Your program should also calculate the monthly payment. d. The program should also allow the calculations to be repeated as often as the user wishes. Explain the part of the code that is causing the repetition