- Strength to Increase Rep
- +2
- Strength to Decrease Rep
- -0
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Re: [code=c] #include <stdio.h> void main() { int d,m,y; int days=0; int k; // return var printf("input date dd.mm.yyyy\n"); scanf("%d.%d.%d",&d,&m,&y); m--; switch(m) { case 11:days=30; case 10:days+=31; case 9:days+=30; case 8:days+=31; case 7:days+=31; case 6:days+=30; case 5:days+=31; case 4:days+=30; case 3:days+=31; case 2:if((!(y%4))&&(y%100)) days+=29; else if(!(y%400)) days+=29; else days+=28; case 1:days+=31; … | |
Re: you need it for dynamic memory allocation. just think of a program where sb has to input a n-dimensional matrix of unkown n. let the user input n and then go forward to get the necessary memory space. next advantage of malloc is that all the memory-places allocated stick next … | |
hi there im wondering about the difference between: int nr; if(!((nr--)%5)){...} if(!((nr--)%5)){...} and: int nr; if(!(--nr)%5)){...} if(!(--nr)%5)){...} is it right that in case 1 nr will be decremented after true/false comparison and in case 2 in advance? assuming nr=123456; in case 1 it would be true for second if.... and … | |
Re: i usually use do{...}while(1); 1 is always true, therefore it will stay in the loop. if you want to get out of it, the command "break;" should do it. | |
hello, im totally new to this forum, but i already checked whether my ask is answered somewhere else already. i couldnt find anything... i used to work with dev-cpp and i have to work with the cnum.h library a lot. Since im a student i am able to get MS … |