tim
there are some free ones available online
Dima
unless they are „what is a for loop“ level of beginner
there’s a group for such questions: http://t.me/c_cpp_india
Dima
😹😹
Vlad
Beginners don't need chats imo.
They need to solve their problems themselves and start googling their way out.
tim
They need to solve their problems themselves and start googling their way out.
> solve their problems themselves > start googling
tim
Vlad
> solve their problems themselves > start googling
Most folks asking here want to be spoon feeded
Dima
yes
tim
It shouldnt become a habit to always ask others
tim
especially if they always seek out for the same people to help
tim
Why be independent when you can be comfy?
Henry
okay thank
Dark
int retFunc(void) { return 42; } void vFunc(void) { static int secret; secret = retFunc(); } int main(void) { return ((int (*)(void))vFunc)(); } hi, in this code why we have return value !? i guess int (*)(void) are point to stack address but why print value ?
Lorenzo
what mean ''' return ((int (*)(void))vFunc)(); '''
Vlad
Which is UB
Anonymous
How? Is it not formatted correctly because he didn't use monospace?
Vlad
Wait
func_name is it's address
Anonymous
I see now, why is he doing that
Anonymous
That's not right
Dark
and then call it
my problem are why this have return value ? i point to void function not a return value function! if i use this unsigned char array[]=................... . . . ((int(*)())array)(); this run it because RIP set with array function address
Alex
my issue in concept
what do you mean? return value in main is used by OS, to get your program status code
Alex
0 - means your program terminated correctly, other value - something wrong
Alex
why this function have return value?->vFunc is void
to notify OS if your program terminated correctly or not
Alex
add just return 0; in main
Dark
add just return 0; in main
bro i mean this : void vFunc(void) { static int secret; secret = retFunc(); } i know what is return value in main function.
Dark
this is ok. what is the problem? you ask why somebody write this code?
you think this function have return value ? it's normal?
Alex
vFunc does not have return value, retFunc has
Dark
vFunc does not have return value, retFunc has
ok so why we point to none ret function but have return value (This has confused me🤯)
Alex
void vFunc(void) { static int secret; secret = retFunc(); } we just called retFunc(which has return value) and assigned this return value to secret var. I can`t see where we point here
Dark
int (*)(void) this point to function with void parameter correct?
Alex
int (*ptr)(void), ptr - is pointer to function with no parameter and int return value
Dark
int (*ptr)(void), ptr - is pointer to function with no parameter and int return value
OK 👍 But , code is ((int (*)(void))vFunc)() -> vFunc is void function
Dark
That is undefined behavior
what is your mean ? can you explain that ? thanks
Anonymous
what is your mean ? can you explain that ? thanks
When I mean undefined behavior, it means it cannot be explained
Alex
OK 👍 But , code is ((int (*)(void))vFunc)() -> vFunc is void function
you cast function which return no value to function which return int. this is illegal
Krypton
how to check a inbuilt function of c++ code from vscode?
Krypton
ohkay
Krypton
whats this #numbers? #1 #37
Igor🇺🇦
how to check a inbuilt function of c++ code from vscode?
What I have in my installations is this extension https://marketplace.visualstudio.com/items?itemName=ccls-project.ccls And compilation database for my project.
Flipchan
Hihi
Dima
nonohello.com
Vlad
whats this #numbers? #1 #37
whut the actual fudge is this?
olli
whut the actual fudge is this?
preprocessor output (e.g. gcc -E)
olli
whats this #numbers? #1 #37
You probably don't need to care about that, you can read more about GCC's preprocessor output here https://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html Source file name and line number information is conveyed by lines of the form # linenum filename flags These are called linemarkers. They are inserted as needed into the output (but never within a string or character constant). They mean that the following line originated in file filename at line linenum. filename will never contain any non-printing characters; they are replaced with octal escape sequences. After the file name comes zero or more flags, which are ‘1’, ‘2’, ‘3’, or ‘4’. If there are multiple flags, spaces separate them. Here is what the flags mean: ‘1’ This indicates the start of a new file. ‘2’ This indicates returning to a file (after having included another file). ‘3’ This indicates that the following text comes from a system header file, so certain warnings should be suppressed. ‘4’ This indicates that the following text should be treated as being wrapped in an implicit extern "C" block.
Venky
if input =6 ccsskk ccsskk ss..ss ss..ss kk..cc kk..cc in C language can anyone suggest the logic for this pattern
King
Happy Diwali all
Venky
when we enter input =6 then it will display the pattern 1st line ccsskk 2nd line ccsskk 3rd line ss..ss 4th line ss..ss 5th line kk..cc 6th linekk..cc
Luca
hello guys, is there someone skilled with visual studio 2019?
olli
hello guys, is there someone skilled with visual studio 2019?
yes, there are people in this group proficient with VS2019
Gulshan
how can I add %d recussively ?
Gulshan
how can I add %d recussively ?
Pasted successfully! Dogbin URL : https://del.dog/lippugikig.txt
Gulshan
Luca
yes, there are people in this group proficient with VS2019
I've a problem with one of my colleagues. We are trying to share a Cmake project written in VS2019, the problem is that in CMakeSetting.txt each library refer to path on his pc and not mine. Have I to change manually each path in Setting, or is there any automatic way to make this?
olli
how can I add %d recussively ?
Why do you want it "recursively"? You can have a loop that reads all the values. Be aware that C++ does not support VLAs, so it might be better to use std::vector<int> instead of int a[n]
Gulshan
since it will check the new line for input
olli
since it will check the new line for input
no, it does not check for new lines. It will read whatever is there
Gulshan
thank.. you
Gulshan
i am a idiot, havent tried it with scanf...
olli
I've a problem with one of my colleagues. We are trying to share a Cmake project written in VS2019, the problem is that in CMakeSetting.txt each library refer to path on his pc and not mine. Have I to change manually each path in Setting, or is there any automatic way to make this?
Assuming you're referring to the CMakeSettings.json[1], I am not aware of an automated way to do it, since basically no tool would be able to find your libraries. The easiest solution would probably be to use the same directories or create symlinks for them. [1] https://docs.microsoft.com/en-us/cpp/build/cmakesettings-reference?view=msvc-160