Vinay
Code WHIZ
Why do some compiler uses (int main) instead of (void main )
Because for every process that an os do there is an exit code which tells how it behaved . So its good to have return code like 0 which means all went perfectly as indented.and may returns some code if an error occur on to which we can see what is problem
Code WHIZ
Gulshan
Anshul
'''''''
Vitrag
'''''''
Bharti
https://pastebin.com/dSGS1pTx
even after making intersection btw two nodes . iam getting a -1 return value!! any help
Thomas shelby
#include<stdio.h>
#include<stdlib.h>
main ()
{
int *p = (int*) malloc(sizeof (int));
*p=4;
printf("%d", (*p)+++*p++);)
}
The above code prints the op 9
I can understand this operation is similar to i+++i++
But if I remove brackets from this (*p)+++*p++......ie...*p+++*p++ it prints 4
Why does this happen
What's the difference between *p and (*p)
Can anyone help
klimi
>*p and (*p)
they are the same
klimi
Thomas shelby
Then it must print 9 for both the cases nah
1.(*P)+++*p++
2.*P+++*p++
klimi
oh okay
Ammar
Thomas shelby
Mmm
Ammar
klimi
Ammar
https://stackoverflow.com/questions/4176328/undefined-behavior-and-sequence-points
klimi
Please dont post offtopic here, if you want to casually chit chat, visit the offtopic group
Pradevel (Pratyush)
#ot
Mame ¥£~~©©\[§
klimi
Pradevel (Pratyush)
klimi
Undefined behaviour
Pradevel (Pratyush)
@𝑺𝒐𝒃𝒌𝒂
the same compiler in vs code
Anyway. There are only 2 different types of main signatures in the C++ standard:
int main() { /* ... */ }
int main(int argc, char* argv[]) {/* ... */ }
Then, void return types are incorrect in terms of the C++ standard.
Use int as return type of main is good practice as he says above
'''''''
'''''''
@𝑺𝒐𝒃𝒌𝒂
Bharti
Anonymous
Hi guys
Any one have cheat sheet for C++ programming languge?
Anonymous
Hi guys, I am learning bootloader for s32k144, anyone has any link to study that.
Golden Age Of
Oh my hella god, what a monster
Anonymous
can you 1) delete this wall of text, 2) go to godbolt.org, 3) paste the code, 4) use godbolt's code formatter to auto-format the code, 5) share a link to your code on godbolt.
Anonymous
alternatively, you can format the code on your local system and then paste it to wandbox.org and post a link to your code on wandbox
Anonymous
website for c++ practice and problems from zero till the end ?
Anonymous
and even then, books will only make you a master of the language itself. between that and actually being able to write/understand large programs/codebases is a huge gap.
Einstein
Anonymous
so how can i practice from level zero problems till advanced step by step??
Anonymous
Anonymous
thx i appreciate it
zn
hello can anyone help me to solve my assigment
Adrian
z
*Put away your homework GIF*
Anonymous
what setprecision do in c++?
VENUJAN
#include <stdio.h>
int main(){
int x = 0 ;
while (x <= 10){
printf("hello \n");
x+=1;
}
//dcsdc
while (x <= 5 ){
printf("x is %d \n",x);
x++;
}
}
VENUJAN
i wrote this code but got only this output
VENUJAN
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
VENUJAN
why i couldn't get the output for printing numbers?
VENUJAN
there was no any errors showing!
klimi
Say out loud what your program does
klimi
It prints 10x hello word, and then it prints 5-x times hello + number
VENUJAN
klimi
But the x is greater that 5, so that's why it's not printed
Hamidullo 🇺🇿
'''''''
VENUJAN
VENUJAN
thanks
klimi
Np
class Person(Skills): name = str("Ankush Bhagat")
Added %d --> for 1st while loop which contains hello for 10x
class Person(Skills): name = str("Ankush Bhagat")
If want to print with 1 to 11 then edit " x=0; to x=1;
Anonymous
Mr.AL-Aramy
Lunatic
Hi anybody can suggest a book for c++
Anonymous
Hello everyone. The firstly I'm Oybek, from Uzbekistan and I want to learn c programming so where i can learn it better? Could you give some advace?
Anonymous
I mean in which country
Anonymous
Anonymous
There are many books that you can buy to study or use the documentation (free)...
Vitrag