Anonymous
What appropriate input function for string should i use to store value into an empty array? And how? 😬
Anonymous
In C
Engineer
English isn't a basis of intelligence I guess, besides it's just a typo error.
Hear hear! I used to teach English when I was at university in London, to foreign students learning English in London. It was easier to assume the person was clever than me and if I listened and tried to understand them I would learn more. Having just one spoken human language limits your thinking and thoughts🤓
Victor D.
Like scanf("%s",szArray);
Vlad
Like scanf("%s",szArray);
Wait what? This isn't right
Vlad
Consider using fgets or gets_s for the string input
Victor D.
Wait what? This isn't right
Sorry you're right. I got confused with sprintf
Vlad
scanf("%s", string) isn't safe
Vlad
scanf("%s", string) isn't safe
No buffer overrun checking or anything
Vlad
scanf("%s", string) isn't safe
Glad that canary exists. Jumping to malicious code after return ain't fun
many
Are there any high speed and lightweight c++ libraries for logging?
Igor🇺🇦
Are there any high speed and lightweight c++ libraries for logging?
This one is pretty popular https://github.com/gabime/spdlog
many
This one is pretty popular https://github.com/gabime/spdlog
Wow it achieves writing 1.6mil messages even in racing condition
Ahmad
can any one make copy constructor for doubly linked list please
Anonymous
Hi everyone...!!! Is there any c++ programmer?
olli
can any one make copy constructor for doubly linked list please
https://github.com/llvm/llvm-project/blob/main/libcxx/include/list#L1280
Anonymous
many
Hiring?
Anonymous
Ooh sure?
Definitely
Anonymous
Definitely
Ok dear
Anonymous
Lol
Dima
lol
Ange
Is anyone trading on iq option ?
MLDA
Hello how to add numbers for new empty array
Ange
If its an int array use a for loop
Olexiy
/get cbook
🇵🇭🇷🇺
#include <iostream> using std::cout; using std::cin; int main() { int UserNumber; char Grade; cout << "Enter your grade scored in the Programming class: "; cin >> UserNumber; cout << "\n\n\n"; if (UserNumber > 90 && UserNumber < 101) { Grade = 'A'; } else if (UserNumber > 80 && UserNumber < 89) { Grade = 'B'; } else if (UserNumber > 70 && UserNumber < 79) { Grade = 'C'; } else if (UserNumber > 60 && UserNumber < 69) { Grade = 'D'; } else if (UserNumber > -1 && UserNumber < 59) { Grade = 'F'; } else { Grade = 'Z'; } switch (Grade) { case 'A': cout << "Perfect! You got: " << Grade; break; case 'B': cout << " You got: " << Grade; break; case 'C': cout << "You got: " << Grade; break; case 'D': cout << "You got: " << Grade; break; case 'F': cout << " You got: " << Grade; break; case 'Z': cout << "Undefined value! Make sure it's a value from 0-100!"; break; } cout << "\n\n\n\t\t\t"; return 0; }
🇵🇭🇷🇺
Thanks 🙁
Diego
Scarlett Try to use ` `` for code, before and after, so it looks like myClass{ int val = 0; }; Also for long things try to use https://gist.github.com/
Diego
If you wish to validate then add an extra if that checks if it's less than 101, if so, output that it's invalid
🇵🇭🇷🇺
But it keeps on appearing that 89-100 is undefined
Diego
Paste the code in the big text box, add a description or a filename optionally
Diego
Then just click create and it'll give you a link
V
Hey everyone, ¿how are you? I need some help on one particular issue. I'm very new on programming, not even a year on this. So please bear with me. I'll try to explain the best way I can my issue.
V
Its kinda long explanation, so I asked for permission to admin Dima and said its okay.
Anonymous
```#include <stdio.h> #include <string.h> int main(){ const int SIZE = 100; char letter [SIZE]; int num,i; int num2; scanf("%d", &num); for(i=0; i<num; i++){ scanf("%c", &letter[i]); } scanf("%d", &num2); int index=num2; printf("%c", letter[index]); return 0; }```
Anonymous
Why does the loop count twice?
Diego
But it keeps on appearing that 89-100 is undefined
https://gist.github.com/DiegoG1019/b4d4bb16bd06c53bf31f7131d5c07653
Diego
Try this out I put your get grade code into a function, and UserNumber is now an argument I use a foor loop that stops when i > 150 and each loop adds 5 to i Should be much easier to see where the mistake is
Diego
It seems to be every time there's a 10th number; maybe the problem is using > and < rather than >= and <= Try out changing those where you see it relevant
Terror
Hey guys! I'm new to c++ ,while I'm reading the book c++ primer, I try to do some experiment with the problem 12.24, but there's something out of my expect and made me confused, here is my code #include <iostream> int main(int argc, char* argv[]) { char * a = new char[10]; std::cin >> a; std::cout << a << std::endl; delete [] a; return 0; }
Terror
after compiling it I tried to enter some string longer than 10 but still got the full string
Terror
Is there something wrong with my code or just compiler's magic?
.
Hi can you help me in the exams c++?
Terror
https://stackoverflow.com/questions/36517571/cin-writing-out-of-range
Anonymous
سگ توش ادم تا میخاد درس بخونه همه چی بهش خوش میاد همین الان میخواستم لپ تاپو تمیز کنم کیر توش
J
Anonymous
Please take Jetbrains Developer Ecosystem Survey 2021 Let's make developer tools better https://surveys.jetbrains.com/s3/developer-ecosystem-survey-2021-sh?pcode=966683602426201088
Ali
Why does the loop count twice?
%c does not skip white-space before converting a character scanf(" %c", &letter[i]); Try adding a space before %c in scanf like above
Anonymous
Like what?
Open the link, it listed there
ʙᴀнᴀᴘᴀм
any C developers here?
Anonymous
ʙᴀнᴀᴘᴀм
Jesvi
Hi
Evil grin
Is there a centralised place to find 3rd party libs to do whatever you want
Evil grin
Like npm
klimi
be quiet
well you got one from me
Anonymous
Like npm
conan, vcpkg