𝕷𝖔𝖗𝖊𝖓𝖟𝖔
I see you are working on a server if it is something serious you might want to use asynchronous networking something like epoll for Linux or kqueue for BSD or Macs or a cross platform library they are all let you set timers, but libraries do it in a more friendly way but if you insist on using threads you can use pthread_cond_timedwait
Thank you so much! It is a college project, so nothing serious, thought the professor is really strict and wants perfection in the code, therefore I'm looking for the best way possible. I'll look at both the alternatives, thank you so much!
Hussein
Thank you so much! It is a college project, so nothing serious, thought the professor is really strict and wants perfection in the code, therefore I'm looking for the best way possible. I'll look at both the alternatives, thank you so much!
you are better off with threads for ease of use in this case. in collage professors don’t care how well you do it, they only care if you do it. but for your personal projects consider using the native libraries above or libuv, libhv, libev, these are cross platform libraries that work on every OS, if you don’t want to do things from scratch.
Ludovic 'Archivist'
Learn to Learn
Yep, until you can learn a programming language in 3 weeks
İbn
Using functions, write a program to read the elements of two matrices with real numbers of 5, then print the result of addition, subtraction, multiplication and division of each element of the automatic matrix with the corresponding from the second matrix?
Leovan
Anyone can explain me, please, the best way to include assimp (https://github.com/assimp/assimp) library to my project? I have my project which i built using CMake (WARNING: It is important for me to work both generators: Ninja and Visual Studio). So, I added assimp from git as submodule to my project and as suggested in the assimp docs I added this lines to my CMake: add_subdirectory(assimp) target_link_libraries(rt assimp) As I understand first line use CMakeLists.txt from assimp's directory and compiles it (btw its .dll by default). That's what I don't understand: 1) If target_link_libraries(rt assimp) link my .exe with static .lib, so why after that my .exe anyway requires additional .dll? It's uncomfortable for me (and first of all for users which use my project) to move .dll to .exe dir after compilation (even if it only needs to be done once). 2) Also, as alternative I tried to compile assimp as static .lib, as specified in the documentation I should use -BUILD_SHARED_LIBS=OFF for that, but how to set this flag from my main CMakeLists.txt? As for me I mustn't change assimp's CMakeLists.txt, because users will clone it from assimp's git, not from mine. Variants like download assimp using vcpkg or add PATH don't work for me, because my main target is: user should just clone my project from my git with submodules and compile it with all libraries using only my CMakeLists.txt, without additional actions.
pavel
Vcpkg broking my life
ngdream
Please who knows how to use bison and flex here
ngdream
I need help
labyrinth
If I compile a program with O2 optimization, does it make sense to set any breakpoint?
labyrinth
because I had a time when I ran the binary with vscode debugger, it paused at a line when the assertion failed, which is not the correct line
void
If I compile a program with O2 optimization, does it make sense to set any breakpoint?
It's an interesting question, should we trust the decisions made by the compiler?
void
On the other hand, do all compilers optimize with the same criteria?
Anonymous
Anyone can explain me, please, the best way to include assimp (https://github.com/assimp/assimp) library to my project? I have my project which i built using CMake (WARNING: It is important for me to work both generators: Ninja and Visual Studio). So, I added assimp from git as submodule to my project and as suggested in the assimp docs I added this lines to my CMake: add_subdirectory(assimp) target_link_libraries(rt assimp) As I understand first line use CMakeLists.txt from assimp's directory and compiles it (btw its .dll by default). That's what I don't understand: 1) If target_link_libraries(rt assimp) link my .exe with static .lib, so why after that my .exe anyway requires additional .dll? It's uncomfortable for me (and first of all for users which use my project) to move .dll to .exe dir after compilation (even if it only needs to be done once). 2) Also, as alternative I tried to compile assimp as static .lib, as specified in the documentation I should use -BUILD_SHARED_LIBS=OFF for that, but how to set this flag from my main CMakeLists.txt? As for me I mustn't change assimp's CMakeLists.txt, because users will clone it from assimp's git, not from mine. Variants like download assimp using vcpkg or add PATH don't work for me, because my main target is: user should just clone my project from my git with submodules and compile it with all libraries using only my CMakeLists.txt, without additional actions.
You could do something like this in your project's CMakeLists.txt file: set(BUILD_SHARED_LIBS_OLD "${BUILD_SHARED_LIBS}") set(BUILD_SHARED_LIBS OFF) add_subdirectory(assimp) set(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS_OLD}") This would ensure that when assimp is built the variable BUILD_SHARED_LIBS would be off and it would be restored to its old value for the rest of the CMakeLists file.
Anonymous
because I had a time when I ran the binary with vscode debugger, it paused at a line when the assertion failed, which is not the correct line
When you compile with -O2, the compiler would enable a lot of optimizations like instructions reordering, loop unrolling, excessive inlining, hoisting of variables and so on. These would render the connection between your source code and the generated machine instructions meaningless. If you intend to debug your code, then don't use optimizations and also ensure that debug symbols are turned on.
urs
Can we run C program in mobile??
urs
I'm beginner
Nomid Íkorni-Sciurus
Nomid Íkorni-Sciurus
And how?
Install Termux then install clang compiler on Termux
urs
Thank u brother
Nomid Íkorni-Sciurus
👍
Rajeev
As we know set<> stores data in sorted order without repeating. But, I want to store data with repeating and sorted order. Can anyone suggest me what should I use.
pavel
And how?
NDK on Android
YUSUF
I want to learn Bluetooth In c++ do any one have idea how I start learning
klimi
I want to learn Bluetooth In c++ do any one have idea how I start learning
Do you already knownhow bluetooth works? Are you interested in implementing a driver or just sending data?
YUSUF
I don't know how Bluetooth works
YUSUF
I want to make a software for sending data
pavel
Use Qt
vijay
any one please help me to find this solution, the question is showing after entering the values.
Gate cse
Anuj Bhaiya dsa course unacadmy jisse chaiye dm me
vijay
the problem is find the sum of 2 numbers in c. i write the code and build it. while running the c code , in the console is shows the answer and question in a same line after entering the vlaues
pavel
\n
Tharun
Does anyone's know about desktop development C++
klimi
Chri~
g++ /tmp/myrPzklwY7.cpp /tmp/myrPzklwY7.cpp: In function 'void Output(int, std::string, int, int)': /tmp/myrPzklwY7.cpp:86:107: error: expected ';' before string constant 86 | << nome << " lancia dado e ottiene" << lancio << "\n" << nome " lancia dado e ottiene" << lancio << "\nPunteggio parziale: " << nome << " : " << punteggio << " -- " << nome << " : " << punteggio; | ^~~~~~~~~~~~~~~~~~~~~~~~~ |
Chri~
someone can help me with this prob?
pavel
Missing<<
Chri~
ty
Anonymous
bool quit = false; while (!quit) {quit = true;} vs while (1) {break;} Does break technically bad ?
pavel
Nope
Farivar
Hi, I just had this question for a long time abt address buses in CPUs and how we can measure our CPUs address bus width, I had read an article about the amount of supported RAM in different CPUs, and it was said that 2 to the power of the number of CPU bus address wires width(2^Address Bus Width = Addressable amout of memory by CPU). here is the question; For example an 8088 CPU that has 20 bits address bus, which is equivalent to 1,048,576 bytes although equal to 1 MB of RAM(it can address and support 1MB of RAM), even though its registers are 16 bits(So the calculations were not performed on the registers; it performed on address bus width), but a 32-bit CPU is not measured by the address bus width like 8088, it performed on 32 bit registers(vice versa) and the bits are measured is equal to 4GB, which we all know about(for those who dk, 32 bit CPUs cant address more that 4GB of Ram for example if you snap in an 8GB Ram it only supports 4GB of it!). And the 64 bit cpu is measured in the same way as 32 bit, does this mean that the 32 bit cpu has 32bit address bus width and the 64 bit cpu has 64? If this is the case, then why do 64-bit CPUs that address petabytes of RAM have a RAM support limit of less than 128GB depending on the CPU model in most cases; and if this is not the case, then why do we address the size of rigesters for amount of addressable RAM?
Leovan
You could do something like this in your project's CMakeLists.txt file: set(BUILD_SHARED_LIBS_OLD "${BUILD_SHARED_LIBS}") set(BUILD_SHARED_LIBS OFF) add_subdirectory(assimp) set(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS_OLD}") This would ensure that when assimp is built the variable BUILD_SHARED_LIBS would be off and it would be restored to its old value for the rest of the CMakeLists file.
So i can declare flags in any CMakeLists.txt - is it global for all CMakeLists.txt (subdirectories) anyway? ————————————————————————— And anyway its compiles two files: bin/Debug/assimp.dll lib/Debug/assimp.lib I thought that I could choose one of them, but after target_link_libraries(rt "assimp") the .dll is still required. So, are this two different libs (the code is divided into two libraries: dynamic and static) and should I use both?
Arm
I made a silent installation of sql express that when I give the program to the user, it will silently install the sql express software for him. Now, to run the silent installation, I need to write two separate command lines in the command prompt. I want to write a code in the console application that when the console application is run by the user, the command prompt will open and at each step, execute a line of commands to execute the silent installation. How can I do this?
Map
I need source code Where someone can download PDF or Book for free Please Guyz Any help
Map
pdfdrive zlib
I need the source code bro
Map
I want same website like PDF drive
ss..
1lib.in is also a good website from where you can download almost any book and it is also aternate to pdfdrive
ss..
instead of clinking on link above you should manually type 1lib in the google search bar
ss..
*clicking
Vez_Man
House am new to c programming. Please how do I start? Is there any application I will download for use in my PC
Vez_Man
Get a compiler and an IDE
Thank you for your advice 🙏
Anonymous
So i can declare flags in any CMakeLists.txt - is it global for all CMakeLists.txt (subdirectories) anyway? ————————————————————————— And anyway its compiles two files: bin/Debug/assimp.dll lib/Debug/assimp.lib I thought that I could choose one of them, but after target_link_libraries(rt "assimp") the .dll is still required. So, are this two different libs (the code is divided into two libraries: dynamic and static) and should I use both?
I am not sure about assimp as I haven't used it. Read their documentation to find out how it works. I just helped you with the CMakeLists file. You can't declare it in any CMakeLists file. You have to do it in the one where you declare the dependencies. This is the parent for the CMakeLists file within the dependencies and can pass in variables. This is as good as calling the CMakeLists file for the dependency by providing a cache lists file. I
Lawal
Hi i need an algorithm to sort an array of integers in C
pavel
Bubble sort
Lawal
Bubble sort
Yeah any one
Lawal
I mean the code or the pseudo code the idea how do i sort is there a function?
klimi
I mean the code or the pseudo code the idea how do i sort is there a function?
If you are totally lost you can watch YouTube videos or even consult wikipedia
Shunya
I want to learn c++ , can anyone teach me , pls dm ??
Ronnie
Hell
klimi
.
Only first "scanf" is asking to enter the value. How can i fix it?
.
you have 2 scanf calls but only one works?
Code I wrote is Int main() { Clrscr(); Char word; Printf("enter any word:"); Scanf("%c", &word); Int number1, number2, sum; Printf("enter two numbers:"); Scanf ("%d %d", &number1, &number2); Sum=number1 + number2; printf("result %d +%d=%d" , number1, number2, sum); getch(); }
klimi
you are taking as input one character (not a word like you are printing) and then 2 numbers, which works
nox
Hello World
nox
Anyone pls material on how to develop C software