klimi
Example for while , for , we can use c programming but range we can't use c programming
what are you referring as range? (you have the cited loops for that)
Anonymous
Example for while , for , we can use c programming but range we can't use c programming
while loop: while (true) { puts("hi"); } for loop: for (int i = 0; i < 20; ++i) { puts("hi"); } recursion: void hello() { puts("hi"); hello(); }
Anonymous
Hlo guys
Ludovic 'Archivist'
Whoever came up with the format for icu state machines for parsing unicode is a complete monster
Ибраги́м
Ludovic 'Archivist'
At a point in the future, we are all likely to be monsters
Man, those state machine are written in a sort of bnf/regex from hell script format
Ибраги́м
Man, those state machine are written in a sort of bnf/regex from hell script format
OK, now they're monsters. You mean the same libicu ?
Ludovic 'Archivist'
We are writing an alternative in c++20 and my god using their datafile will be complicated
Ибраги́м
Ибраги́м
To be sincere, I've never had to directly deal with it.
Ludovic 'Archivist'
I hope your obsession with Unicode correctness pays off.
Well, it is my colleague obsession with correct code that is the hardest to deal with xD
Ludovic 'Archivist'
Why didn't you use Rust ?
The only thing slower to compile than C++ is Rust, also, C++ with 99% of things immutable is still very flexible
Ludovic 'Archivist'
Rust is rigid and I would have to write too much unsafe code just to have a Freestanding standard library
Ибраги́м
It was wasted opportunity.
Ибраги́м
To make something seasoned C++ devs can actually like.
Ибраги́м
Seem the Wall is still undefeated.
Ludovic 'Archivist'
It was wasted opportunity.
Elapsam semel occasionem non ipse potest Iuppiter reprehendere Even Jupiter can't recover a lost opportunity
Ludovic 'Archivist'
To make something seasoned C++ devs can actually like.
Well, if the dev cycle was not 1/fight the dumb borrow checker that doesn't know what an array is then 2/ fight the logic errors you introduced fighting the checker 3/ rince and repeat, I would consider using it. But guess what, writing monads and dependent types based code in C++ is faster to do, it compiles faster and it is harder to write logic errors
Ludovic 'Archivist'
Since 80% of my code never mutates shit and the rest is too hairy for rust, I would get all drawbacks no benefits from using it
Ludovic 'Archivist'
Copy ?
Either shared immutables with reference counting or stuff that is copied or passed as a message
shuzuya
Yes
Hanz
#ASK What is a practical use case of union in C? I don't see it ever used anywhere 🤔
Anonymous
😊any body ans plz
Anonymous
What are the types of errors in C programming?
olli
#ASK What is a practical use case of union in C? I don't see it ever used anywhere 🤔
to save memory, basically all small buffer optimizations use unions
Ncamiso
I wrote a program that's supposed to read from file and count total number of students in IT and BIT, I used count++ but instead of writing the total number of students in each course it write: BIT 1, BIT 2,BIT 3 yet I just want it to write : BIT 3
Zade Meadow
What are the types of errors in C programming?
Syntax error Run-time error Linker error Logical error Semantic error
Anonymous
what is runtime error,linker error and semantic error?
Anonymous
Hello what is the use of long long unsigned int behind long long int
only positive - unsigned positive and negative (default) - signed long long unsigned int is a 64 bit only-positive number type long long int is a 64 bit positive and nagative number type
Anonymous
put it on pastebin, it's unreadable without you putting your code in a code block or pastebin eith C++ code highlighting
Anonymous
nvm i see it
Anonymous
you put else when it should be else { /* code here */ }
Ashish
Use \n instead /n
Anonymous
Use \n instead /n
it was a bunch of things, not only that
Anonymous
i fixed the code
Anonymous
Thanks
Anonymous
hi admin is it possible to share articles about C or C++ in this group?
Anonymous
hi admin is it possible to share articles about C or C++ in this group?
idk try it, if they don't like it - they'll delete it
You
Given a number in the range of 100 and 999, write a program to accept input and validate this range. The program should exit if the number is out of range. Otherwise, it should reverse it. For example, if the number is 258 then the reverse is 852.
You
Any one??
You
Yeah I know I want assistance if you can help me
Anonymous
Yeah I know I want assistance if you can help me
stop DMing me because I won't help you cheat school work
Juan
What's the point of (++a)=20?
Juan
Which causes error in c
Anonymous
What's the point of (++a)=20?
for example if a = 1 then the thing you sent means 2 = 20 which is not what you can do
Juan
But its result is twenty with g++
Juan
Regardless of original value
Anonymous
hm, idk then
Juan
Thx anyway 🙂
Anonymous
Pavel
But its result is twenty with g++
As far as I understand the result of ++a expression is a reference to the original value (a++ will give temporary instead). This seem to work on a built-in types as well (probably for consistency). https://en.cppreference.com/w/cpp/language/operator_incdec
Pavel
What's the point of (++a)=20?
But I won't suggest to write code like this, this is not readable and doesn't give any benefits in comparison to ++a; a = 20;
Juan
mov DWORD PTR [rbp-4], 10 add DWORD PTR [rbp-4], 1 mov DWORD PTR [rbp-4], 20 https://godbolt.org/
Juan
#include<iostream> using namespace std; int main() { int a=10; ++a=20; cout<<a<<endl; return 0; }
Anonymous
Hello guys. I wonder why, once assigned a certain quantity of memory to a pointer, I can still store values that exceed that quantity of memory. e.g. char* buffer = (char*) malloc(sizeof(char) * 2) // Looks like I can still assign > 2 char to this pointer
Pavel
Hello guys. I wonder why, once assigned a certain quantity of memory to a pointer, I can still store values that exceed that quantity of memory. e.g. char* buffer = (char*) malloc(sizeof(char) * 2) // Looks like I can still assign > 2 char to this pointer
That would be UB, you will write into some memory belonging to other objects (e.g. overwriting data of some arrays/structs) or try to access memory that doesn't belong to the app (which will crash the app probably)
Pavel
I guess some compilers can also allocate some additional space in debug mode to catch out of bounds errors when under debugging
Anonymous
why is everyone laughing
Anonymous
Printf("space"). Line no. 12..
Anonymous
Printf("space"). Line no. 12..
you're not formatting anything, why not just use puts()? it's more minimal
Anonymous
Does it put the space?
Anonymous
Or waits for holding string
Anonymous
What does mean String
Anonymous
Does it put the space?
puts(" ");
Anonymous
Yes
also the pricess' problem is solved already
ꍏꈤꀸ
Hi, what is the best way to synchronise C++ and C# processes?
Abdulaziz
how to compare long long and unsigned long?