Earl B
hi. as a beginner myself. i find learning through exercise is better and i found this two site offer free exercise leetcode and xcersim. (i do c and c++ mostly) how about we learn from there and discuss here for any trouble? cmiiw
Yeah exercises are definitely the best way to learn. I felt a huge accomplishment when i did the first exam in that series of videos. It was to determine the third side of a triangle and while they did give hints, i still had to look up how to use the sqrt function
Gleb
Hi guys, has anyone here used Takion Developer API, which is on C++? I wasn’t able to able any documentation, so was seeking for an advice how to proceed...
Anonymous
Hi everyone, Can you recommend boost.asio courses, tutorials and books?
ninja
check the documentation of boost.asio... and is your project for learning you can also check POCO lib
ninja
if*
M
#include<stdio.h> int main() { char j =1; while(j <= 255 ){ printf("%d", j); j++; } return 0; }
M
What is the reason for infinite loop
M
Can anyone tell me the reason it went like this
ninja
use int!
M
I know
M
But why when I chose char
M
Goes like this
Anonymous
Goes like this
char data type can only accept a value between -128 and 127, look at the while condition again.
M
So when it got value more than 127 that bring us back to _128 like a circle 400 degree is equal to 40
M
Ohhhh I understood
M
Sorry for my stupidity
Anonymous
How to learn c/ c++ from scratch??
Diego
How to learn c/ c++ from scratch??
Starting to would be a good start
Li
#include <iostream> #include <vector> using namespace std; class Stack { private: string elems; public: bool empty() const { return elems.empty(); } }; int main() { vector<int> b; Stack test; b.push_back(1); cout << b[0] << endl; bool a; cout << "a = " << a << endl; return 0; } I don't know why the "a" output a number which greater than zero. And if I don't use the "b.push_back" then the "a" output zero.
Li
May be because you didn't initialize it
I know this reason, but I want to know the basic reason. May be about "static" ?
Sandeep
I know this reason, but I want to know the basic reason. May be about "static" ?
https://stackoverflow.com/questions/3845353/what-will-be-the-default-value-of-an-uninitialized-boolean-value-in-c/3845383#:~:text=The%20value%20of%20the%20bool,nothing%20has%20used%20it%20previously.
Li
wow! thanks!
Kenny
good morning, i need to improve efficiency in knapsack problem with backtraking, i've already use pesimistic and optimistc bounds, some ideas?
Diego
It's not morning for me, so I guess I don't have any ideas
Sandeep
Box of
anyone know how to resize linux terminal with ncurses?
Anonymous
welp i got my memory socket working, i just used my Ordered_Access implementation that i use for my instruction pipeline :) https://wandbox.org/permlink/1gj1HlCIlmsdh3S5 (no idea why i did not think of that earlier)
Anonymous
#include <iostream> Using namespace std; Int main(){ String text[ ]={"house","money","jetin"} For(int b=0;b<3;b++){ For (int I =5;I>0;I--){ Count<<text[b][i]<<flush; } } } Please Am trying to reverse each of the words but I get a debug assertion failure error
Rakesh
#include <iostream> Using namespace std; Int main(){ String text[ ]={"house","money","jetin"} For(int b=0;b<3;b++){ For (int I =5;I>0;I--){ Count<<text[b][i]<<flush; } } } Please Am trying to reverse each of the words but I get a debug assertion failure error
#include <iostream> using namespace std; int main(){ string text[ ]={"house","money","jetin"}; for(int b=0;b<3;b++){ for (int I =5;I>=0;I--) cout<<text[b][I]; cout <<endl; } } Run this You will understand what wrong you did
Anonymous
Anonymous
https://wandbox.org/permlink/HN1rTvvYzswG9Hho how would i turn this into a non blocking function?
•‿•
Write a program to find greater of four number entered by user ?
•‿•
i have this question i wrote a code i want a correction can anyone help me
•‿•
Write a program to find greater of four number entered by user ?
#include <stdio.h> int main() { int a,b,c,d ; int num; num=a,b,c,d ; printf("Enter your number a \n "); scanf("%d", &a); printf("Enter your number b \n "); scanf("%d", &b); printf("Enter your number c \n "); scanf("%d", &c); printf("Enter your number d \n "); scanf("%d", &d); if (a>b) { printf("%d is high number \n"); } else if (b>c) { printf("%d is high number \n"); } else if (c>d) { printf("%d is high number \n"); } else { printf("%d is high,number"); } return 0; }
Ибраги́м
https://www.youtube.com/watch?v=u8Mc_WgGwVY
•‿•
Use array of size four instead of using single variable and compare among elements.
Can you explain more to that actually I am new in programming so explain a little bit more please
•‿•
Thanks
someone help me , why it repeat 2 times when i run it ?
#include <stdio.h> int main () { char ch ; do { fprintf(stdout,"\nr) register a patient : \n"); fprintf(stdout,"\ns) search for a patient : \n"); fprintf(stdout,"\nD) discharge for a patient : \n"); fprintf(stdout,"\nL) list patient by age : \n"); fprintf(stdout,"\nx) exit the program : \n"); fprintf(stdout,"\nchose a option: "); fscanf(stdin,"%c",&ch);
switch(ch) { case 'R': case 'r' : fprintf(stdout,"\nyou have chosen registerin "); break; case 'S': case 's' : fprintf(stdout,"\nyou have chosen ssearchin"); break; case 'D': case 'd' : fprintf(stdout,"\nyou have chosen discharge\n"); break; case 'L': case 'l' : fprintf(stdout,"\nyou have chosen listin"); break; case 'x': case 'X': fprintf(stdout,"\nyou chose exit\n"); break; default : fprintf(stdout, "\ninvalid option\n"); }while (ch !='x');
Anonymous
Format your code
Pavel
What is the best way of organizing code/tests/examples of a C++ library (header-only) in a git repository? Do you know some good examples, or maybe there are some conventions exist?
Pavel
https://github.com/Neargye/magic_enum
Hmm, I'm thinking whether it's a good idea to put the headers directly into "include" folder, especially if there are many of them, because then you have only two choices for include paths: "some_stuff.h" or "repo_name/include/some_stuff.h" The first is too short and can collide, unless I include some prefix to every file name, the second is kind of ugly
Pavel
some_stuff/some_stuff.hpp is not better
In case of the only header, yes, but in my case I don't have anything named with the same name as my repo. Like raccoon-ecs/System.h raccoon-ecs/Entity.h ...
GHAMDAN_NSHWAN
Any questions in the c++language Send me.....
Anonymous
I'll DM u the code
Please share also with me
Alfredo
You might want to read the rules
Distac_221
better you make your own and ask for suggestion..and delete this message before you got banned
Vineet
Hello all! I want to learn C/C++ Know some very initial concepts, finding hard to learn further Any suggestions?🙏
Abhishek
Hello all! I want to learn C/C++ Know some very initial concepts, finding hard to learn further Any suggestions?🙏
https://www.geeksforgeeks.org/c-programming-for-beginners-a-20-day-curriculum/
Abhishek
Follow this blog you'll find all the relevant information
Hirrolot
I would not recommend any websites for C/C++ learning
Hirrolot
They are often full of mistakes and misconceptions
Abhishek
They are often full of mistakes and misconceptions
Brother I'll share this website which all the important topic and you can find all the videos in YouTube from that topic
Hirrolot
https://www.geeksforgeeks.org/arrays-in-c-cpp/ > Array declaration by specifying size // With recent C/C++ versions, we can also // declare an array of user specified size int n = 10; int arr2[n]; We can't always do it in C11 and onwards anymore since VLA is optional
Hirrolot
> Name of the array is also a pointer to the first element of array. It's a common misconception too: int array[10]; // 40 --- 8 printf("%zd --- %zd\n", sizeof(array), sizeof(&array));
Hirrolot
https://www.pearson.com/us/higher-education/program/Prata-C-Primer-Plus-6th-Edition/PGM4399.html C Primer Plus, 6th Edition is good enough for C beginners
Devjit
Can somebody explain me about loops in C programming
Anonymous
Hi
Anonymous
Have any one cracker here!?
Anonymous
It means Crack vps
Anonymous
Crypto
Anyone know how I can start with this algorithm? What steps I have to make sure is in my code? And what runtime Suppose graph G is an undirected graph with unweighted edges. The graph G contains several cycles, and no two cycles share an edge. Provide an algorithm that outputs the length of the longest cycle in G and prints the vertices belonging to that cycle. Justify the runtime of O(V + E)