V01D
Is there any way to trick C into accepting default function arguments / optional function arguments? Or do I have to use C++ for that?
Anonymous
I think thats only there for C++
V01D
Okay, thanks.
Vlad
You may create a helper function with optional parameters declared as pointers
Vlad
And if a parameter is NULL call function with the default that you wish
Vlad
But you still have to put these NULLs in the call
V01D
So if I didn't put NULL in the function call I would get a compiler error, right?
V01D
void func(char* str, void* anything) { // do stuff } int main() { func(NULL, NULL); } This is what I got from your explanation.
Vlad
But I would do just a name convention for that. If you don't have too many optional parameters
Anonymous
https://i.imgur.com/2wgiccC.png
Vlad
void func(char* str, void* anything) { // do stuff } int main() { func(NULL, NULL); } This is what I got from your explanation.
void func_(int a, float b) { } void func(int* a, float* b) { int aa = a ? *a : 12; // 12 is default float bb = b ? *b : 0.0f; func_(aa, bb); } int main() { func(NULL, NULL); }
Anonymous
THis is a brand new install, Still getting this damn error
Vlad
https://i.imgur.com/2wgiccC.png
Шindoшs reinstall time has come :P
Anonymous
THis install isnt even a month old
Anonymous
Any ideas?
Pavel
Any ideas?
The error says that windows sdk is not found, I would start from installing (reinstalling) it. Not sure why it needs it for a console application though.
Vlad
Any ideas?
Try setting existing one in the project settings
Vlad
Chances are they just different versions
Anonymous
/programming
Anonymous
tf is that
Anonymous
But it needs this version.....
Vlad
Get into this menu and change it
Vlad
On the sdk version that's installed on your pc
Vlad
Yeah ms products still are very convenient
Bala
Bala
I am getting this error while I am running my code in dev-c++ app
Vlad
Your .exe could be open
Vlad
If so close it and try again
Bala
Your .exe could be open
Where should open that
Vlad
Where should open that
ctrl + alt + del and check for your exe name in the processes list
Vlad
If it's running compiler cannot override it's file
Anonymous
/get cppbookguide
Anonymous
/get ide
Anonymous
Why is that not working?
Abishek khanna
What is difference between C and C++
Kenny
C++ is like a high level version of C
V01D
What is difference between C and C++
C was built back when a language had a specific use case unlike python which does everything. You can do ALOT with C, however it was built to develop kernels, compilers, etc. C++ kind of bridges that gap. Note that C++ is OOP, where as C is ROP.
Box of
What is difference between C and C++
C is a mess and C++ is even bigger mess
neb
*This post have been vetted and approved by admins!* If someone is interested in a quick and easy way to taste FreeBSD we made a group for NomadBSD which is a persistent live USB distro with ability to install to hardware. Great for testing compatibility. @NomadBSD_public https://nomadbsd.org/
Anonymous
well done
V01D
well done
Kali Linux, eh?
Anonymous
guys, I have a code that generates 4 arrays, two with matches and two that point to matches, to run in 1 repetition, it works smoothly, but when I perform 2 or more repetitions, in each repetition it adds positions in the array in place to simply update the values
Yaw
/get
Yaw
/get cbook
Vlad
Always wondered why in C where it's the most important to name things convenient way some people go for alphabetical variables instead?
Anonymous
Perfect, great code. Especially I like a,b,c,d,e,f but g is missing. why?
I use g in the main and I don't like to repeat variables
Cengizhan
I use g in the main and I don't like to repeat variables
It was sarcastic indeed. Please upload this code on one of the providers and let us investigate whats wrong. It is also missing, whats your problem with this code?
Anonymous
It was sarcastic indeed. Please upload this code on one of the providers and let us investigate whats wrong. It is also missing, whats your problem with this code?
I realized, but as I need help, I have to provide as much information as possible I will generate a pasterbin and the output to be able to clarify the error. basically the offsetZero.coincidences array can only have the predefined size, however when there is repetition, it adds values.
M__
can someone get me this book "The c++ standard library - nicolai m josuttis
V01D
Look yourself, smh
kodes
If I use two nested for loop let's say 'i' and inside 'i' use 'j' and inside 'j' if I use another while loop then will the time complexity be O(n^2) or O(n^3)??
klimi
2 nested loops -> O(n^2) 3 nested loops -> O(n^3)
Artöm
It depends on how i/j changes in terms of n
klimi
No, only if its like i = 1 to n
um .... right.... ye....
Artöm
E.g. this one has logarithmic complexity for (int i = 0; i < n; i *= 2) {}
M__
pdfdrive.com
Got it man Thanks a lot🤝
Artöm
logn
Kenny
Do you know where i can learn about complexity, etc
Kenny
And memoization, and stuff like that
kodes
Do you know where i can learn about complexity, etc
https://www.codechef.com/certification/data-structures-and-algorithms/prepare#foundation
Kenny
Ty man
kodes
You can check here for the resources
kodes
Ty man
Yup no prob