Codigo
Off-Topic: Do you guys suggest any good database software? I want to connect a software I'm creating un C++ to it.
Codigo
Thanks 👍
Amirul
in my system, all the numbers are valid. i just wanna make char invalid
Ehsan
im using this
https://en.wikipedia.org/wiki/Type_conversion I suggest you read this if you want to understand more
Vlad
but what if the user enter character
https://godbolt.org/z/3GxGcG
Igor🇺🇦
in my system, all the numbers are valid. i just wanna make char invalid
Can't you read it as string and check with the method "isdigit on characters?
Ehsan
it’s 4 bytes like int
Ehsan
so you need to banned all 4bytes
Ehsan
all from 0 to 2^32-1 numbers 🙂
Vlad
This troller coaster got too far
Ehsan
This troller coaster got too far
this is what he wants Lmao
Vlad
this is what he wants Lmao
This is a group with some people having subpar english
Vlad
So don't take it super seriously
Vlad
daddy chill
Have you seen my solution?
Amirul
youre helping mate
Amirul
thank you
armandofsanchez
im using this
scanf('%d',&var); if ((var<0)ll(var>9)) { ...printf("%s","error")...}
あおい ハート
/get cbook
あおい ハート
/get cppbookguide
あおい ハート
/get ide
Anonymous
Ok no promo again , /sorry
Ruslan
/sorry
Anonymous
/sorry
ʟᴏɴᴇᴡᴏʟꜰ
main() { unsigned x=1; signed char y=-1; if(x>y) printf("x>y"); else printf("x<=y"); } OP x<=y Why is the op x<=y...?
ʟᴏɴᴇᴡᴏʟꜰ
It was a 1 mark question in my class test😂
K A L V I N
Anyone know about coding?
K A L V I N
👍
Codigo
ʟᴏɴᴇᴡᴏʟꜰ
Tamah
P
Kenny
hi guys, i want to improve the efficiency of my program when i convert from uppercase to lowercase, does anyone know how?
Vlad
Because converting to lowercase is quite cheap. You just substract 32 I believe from each character
Kenny
but i must improve efficiency, this function is part of a larger program(a Tokenizer)
Vlad
And maybe if you're so tight on efficiency look up simd instructions and code it in assembly
Kenny
i do: str [i] -= 32;
Vlad
i do: str [i] -= 32;
That's only one byte at the time
Kenny
one friend talked me about branchless programing to improve efficiency
Kenny
yeah yeah, i know
Vlad
But you may unfold a loop
Kenny
Do you know if it would be a good idea to implement it?
Vlad
But it's likely already done by your compiler
Diego
But you may unfold a loop
Isn't that actually worse for performance by today's standards?
Diego
"On modern processors, loop unrolling is often counterproductive, as the increased code size can cause more cache misses" -- https://en.wikipedia.org/wiki/Loop_unrolling
Diego
If this is wrong, though, please do tell me 😅
Vlad
Isn't that actually worse for performance by today's standards?
In such cases you don't take guesses you test
Vlad
Especially if he claims that his performance is really tight
Vitaliy
Hello, Tell me who knows on which English-language boards of announcements I can sell my e-commerce website (blog/online store on Wordpress)? Thank you
Harshal
I have to use c++98 for application i am developing for, [EDIT2] i want to control the behavior of constructor based on a static member of class, (in my case a boolean) i want to control the behavior of constructor based on if it is a first ever call to constructor or not. For first ever constructor call, i want to execute some extra code but it must not execute in consecutive calls, For this i decided to have a static bool that will have default value of false, and after first constructor call, it will be set true for every other call. class data_sender { private: static bool library_initialized; public: // etc. }; This is kept private because i dont want consumer of this class to manipulate this directly. Its not const because obviously i want to change it inside constructor. Now i cannot assign the default value for this, it says c++ forbids this non-const static variable initialization. I think my approach is wrong here and i should be using some other method. I am relatively new to c++ so even if you point me to some article or tell me what to search for this. [EDIT] Another strange thing i noticed is, when i define the library_initialized as false within the .h file, class data_sender { .... }; bool data_sender::library_initialized = false; it gives me linker error. But if i define it inside the data_sender.cpp, it allows me to do this, bool data_sender::library_initialized = false; // This is inside data_sender.cpp
Chandresh
I'm getting error that unable open include file 'IOSTRAM' in turbo c7 by akki... How do i solve this.!! I want to code a program in c++
Anonymous
Delete it
Chandresh
Chandresh
Delete it
So where to code !!
Harshal
Agreed, if you really want to learn c++, windows - go for visual c++ or mingw linux - gcc/clang
Harshal
Ohk ... thanks 😊
Most probably someone at school or university taught you in turbo cpp. If possible convince them to allow you to use proper compiler instead of turbo c++.
Chandresh
But in visual studio code setting up all things for c++ is some what difficult
Chandresh
So how do i configure 😅
Diego
Just fire the installer and select C++ Development workloads
Diego
Then boot up visual studio itself and click on new project, C++ project, and u good
Diego
Ah wait, my bad, you said vscode 😅