amninder
Anyone suggest aalnything to improve my c++
amninder
Any plateform or anything like that
Anonymous
Codewar
Aakarsh
https://paste.ubuntu.com/p/YYrw5DxtVx/
Anonymous
Thank you soooo much everyone for supporting us... We will be very grateful to you all... Thank you...
Aakarsh
https://paste.ubuntu.com/p/YYrw5DxtVx/
Here I'm trying to implement the consumer producer problem using semaphore it shows segmentation fault can anyone help?
Anonymous
What types of math do i need to learn for problem solving in hackathon contest or codejam...???? Thanks....
EJAH
🙏 Rose I appreciate ma
kodes
map<int, int> m; for(int i=0; i<n; i++) { int val; cin>>val; m[val]++; } Can anyone pls explain what does this m[val]++ mean?
CARLY
Any one who knows how to program mainly in c to DM me
kodes
I need help with c++ coding if anyone willing to help in clearing my doubts pls DM me.
kodes
kodes
Calling ++ on object with key val
Pls elaborate like what values will be stored in 'm'??
Anonymous
I don't think he needs to know about binary trees
kodes
Read about how binary tree works
I have idea about binary tree working but I'm not able to relate it with map
olli
map<int, int> m; for(int i=0; i<n; i++) { int val; cin>>val; m[val]++; } Can anyone pls explain what does this m[val]++ mean?
this map counts how often every number occurs, accessing the map using operator [] gives you the current count for the val specified, using ++ you increment the current count. In contrast to other languages, for std::map if val is not yet in the map it is inserted with its default value. When mapping from int it behaves like an array with enough fields.
Anonymous
olli
Is m an array?
no, it literally says map<int, int> m;
Arhan
/getfreeprogrammingbook
kodes
Is m an array?
No its a standard template library
Faiz
Anyone can help me please?🙏🏻🥺
kodes
Anyone can help me please?🙏🏻🥺
You just have to write a function which displays the ascii values of the range of the characters and display it according to the argument like in here 6 ascii values in one row
Anonymous
can i solve proggramming contest's problems faster with c and c++
olli
can i solve proggramming contest's problems faster with c and c++
You can solve problems the fastest in a language you're comfortable with. Your algorithm is more important than the language you write it in. While native languages tend to produce the fastest binaries, a lot of competitions are designed around this by allowing longer run times for other languages.
Anonymous
Ooooohhhh...thank you sir....
Anonymous
Oooohhh
Anonymous
So i have to learn all language to seize my benifit...
Cengizhan
So i have to learn all language to seize my benifit...
Yes, there are almost 200 languages currently used in the world, so it will not take too much time to learn them.
Anonymous
Ohhhh i seee......
Arseny
Anyone can help me please?🙏🏻🥺
Which help do you expect? Sounds like you need just printing chars from 'ch1' till 'ch2', after 'numberPerLine' chars print new line symbol.
Anonymous
Can any one tell best app codding
Paras
Paras
Paras
I scan 5 variable but on running program 6 value are enter
Futuristic Programmer
Why escape scanf() with an end of line???
Futuristic Programmer
Anonymous
I scan 5 variable but on running program 6 value are enter
https://stackoverflow.com/questions/33905094/scanf-extra-input-required#:~:text=When%20you%20have%20a%20whitespace,each%20of%20the%20subsequent%20%25d%20.&text=Hence%2C%20it%20looks%20like%20scanf()%20requires%20an%20extra%20input.
Nils
int counter = 0; int who = 0; int main() { puts("Initialising..."); setbuf(stdout, NULL); if (fork() == 0) { puts("Hi, I am the child!"); while (1) { while (who == 1); counter++; who = 1; printf("%d\n", counter); } } { puts("I am the parent."); while (1) { while (who == 0); counter++; who = 0; printf("%d\n", counter); } } } Hi, any idea why this gets stuck after having printed 1?
Futuristic Programmer
Fork the process from the parent process first.
Nils
I have the feeling that the variable who is modified for the fork() only
Futuristic Programmer
Fork() function in C - Stack Overflow https://stackoverflow.com/questions/32810981/fork-function-in-c
Nils
counter = malloc(sizeof(*counter)); *counter = 0; printf("%d\n", *++counter); Why does this print 21881?
Arseny
counter = malloc(sizeof(*counter)); *counter = 0; printf("%d\n", *++counter); Why does this print 21881?
What do you expect using preincrement? First it increments pointer, than dereferenced it
Anonymous
Is there some way to learn C++
Nils
Because ++(*counter)?
++*counter seems to work better
Anonymous
Arseny
Is there some way to learn C++
The question is similar to "is there some way to learn [your_technology_here]". The answer is of course yes. Can you rephrase it?
Futuristic Programmer
Futuristic Programmer
How?
Learn it's syntax and code using it,,simple
Asdew
How?
You're not going to learn anything if you just ask and ask and ask about learning. Just search "C++ book" on the Internet, start going through it. Even if the book is bad, you are going to learn more than by asking here.
Nils
Fork() function in C - Stack Overflow https://stackoverflow.com/questions/32810981/fork-function-in-c
int main() { puts("Setting up buffer..."); setbuf(stdout, NULL); puts("Setting up pointers..."); counter = malloc(sizeof(*counter)); who = malloc(sizeof(*who)); *counter = 0; *who = 1; puts("Running..."); if (fork() == 0) { puts("Hi, I am the child!"); while (1) { while (*who != 0); (*counter)++; *who = 1; printf("*%lld = %d\n", counter, *counter); } } { puts("I am the parent."); while (1) { while (*who != 1); (*counter)++; *who = 0; printf("*%lld = %d\n", counter, *counter); } } } Still not woking. :-/
Noor
Any suggestion lightweight scripting language with {} style, unlike lua for game?
Gyan Prakash
Why delete link
Gyan Prakash
Send me
Victor
My knowledge is still in C++98 stage
Just read some new C++ beginner's books, nothing difficult
obi
hello guys if i have a string like this for example : "231,456x" how can I get the two numbers? I read on google you can do it with strtok but I don't understand how it works
obi
c
Wojak
Hello Can anyone provide me a master cheatsheet or a pdf having many array and/or string Questions? I need it to prepare for my placements. It must be solved and in C/C++
Wojak
obi
for exmple 111,123x
obi
i want to save 111 and 123 in two integers