Search found 286 matches

by sumankar
Wed Mar 29, 2006 7:39 am
Forum: C
Topic: malloc
Replies: 12
Views: 6559

What I've gathered over the years regarding this is: [0] There was no consensus on which extension to use -- .h, .hpp, .h++ etc -- whence the idea to drop them. [1] A compiler implementor is free to make a header's declaration available in any form it wishes -- not only files. Hence the decision to ...
by sumankar
Tue Mar 28, 2006 5:19 am
Forum: C
Topic: malloc
Replies: 12
Views: 6559

That was the example I had in mind. #include <stdlib.h> int main(void) { struct mystrct *pstrct = malloc( sizeof *pstrct ); return 0; } will compile without problems on a C compiler. C++ does not allow implicit conversion from void* to any other type. So if you wanted this to get compiled on a C++ c...
by sumankar
Mon Mar 27, 2006 3:59 pm
Forum: C
Topic: malloc
Replies: 12
Views: 6559

kryptolus wrote:I guess I didn't know as much as I thought I did.
Thanks for the correction. :)
It happens to all of us all the time :D
by sumankar
Mon Mar 27, 2006 10:44 am
Forum: C
Topic: malloc
Replies: 12
Views: 6559

Some compilers will give you a warning and some compilers will give you an error... That is not true. If it's a C compiler that you have in mind, you are wrong. You don't need the cast. Simple. Try it out. In fact, a better way to write that would be: struct mystruct *pstrct = malloc( sizeof *pstrc...
by sumankar
Fri Mar 24, 2006 11:02 am
Forum: Other words
Topic: topcoder releated question -- > cheating
Replies: 17
Views: 6757

Re: ...

My advice to all is never teach or inspire anyone, otherwise you will be punished for cheating. And why so? Letting yourself down based on second hand opinion is not the best thing to do. Will uva close my account too. :) I'am planning to create a poll. Guess they will :D i use scanf("%d", &n) to t...
by sumankar
Wed Mar 22, 2006 10:07 am
Forum: Bugs and suggestions
Topic: email notifications
Replies: 7
Views: 3303

And just to highlight how much we miss this particular feature: a couple of days back I had logged in to TopCoder[tm] and happened to chat with a few co-uva/topcoder-members when this particular topic came up. And the unanimous opinion was to bring it back. One major area where this helps a hello of...
by sumankar
Thu Mar 16, 2006 9:10 am
Forum: Off topic (General chit-chat)
Topic: How many posts needs?
Replies: 11
Views: 12150

[...] Abusing the forum isn't cool. While we are at this, I'll put in a word or two. You've seen nothing of abuse till you've read this . This isn't exactly the sort of post you'd like to read before your first cup of coffee. Anyway, for the past few weeks, thanks to some newbie great helpers, I've...
by sumankar
Wed Mar 15, 2006 4:53 pm
Forum: Volume 110 (11000-11099)
Topic: 11011 - Numerical Methods! A Satire
Replies: 11
Views: 6370

Well, I dozed off in every single CS course that I had to take (though I have a degree in CS ;) ) while in college (which is as far as I could get, crawling on all four limbs.) And that answers your question! On a more serious note, I would surely like to add, that there were very very few profs in ...
by sumankar
Wed Mar 15, 2006 9:20 am
Forum: C
Topic: Please Help Me...
Replies: 1
Views: 2442

Re: Please Help Me...

Timo wrote:I have a code like this :

Code: Select all

[...]
  y=x++ * ++x;
  x=4;
  printf("%d %d\n",y,  x++ * ++x);
The nadir of Undefined Behaviour!
Multiple ambiguous side-effects within a single sequence point. For more:
http://c-faq.com/expr/evalorder2.html
by sumankar
Tue Mar 14, 2006 8:40 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 189259

Re: Repeated Compiler Error

My code compiles fine in my gcc..but the judge throws up compiler error always... The judge's C compiler gets high on C++ comments. I couldn't help but comment on a few other things in your code viz : #include<stdio.h> #include<stdlib.h> //This function returns the 'cycle length' for n, as defined ...
by sumankar
Wed Mar 08, 2006 3:52 pm
Forum: Volume 110 (11000-11099)
Topic: 11001 - Necklace
Replies: 38
Views: 17349

Thanks! ... Are you sure you don't report a value outside this range where L(n) becomes imaginary? Well, I no longer have a way to check it, off-hand. I was so pissed off with having a WA with this one, I well ... trashed the 20-odd lines. ;) Hope my previous post isn't a spoiler. Realized it only n...
by sumankar
Wed Mar 08, 2006 2:58 pm
Forum: Volume 110 (11000-11099)
Topic: 11001 - Necklace
Replies: 38
Views: 17349

Need help! This is what I tried:

Code: Select all

 
[1] L = n * D = 0.3 * n * sqrt( Vtot/n - V0 )
[2] L' = 0 && L'' < 0 or so on ...
What am I missing?
by sumankar
Wed Mar 08, 2006 8:12 am
Forum: Other words
Topic: Request For section CX on board
Replies: 2
Views: 1606

Request For section CX on board

Admins, can we have a section for CX under Help on the Problemset?
by sumankar
Mon Mar 06, 2006 9:34 am
Forum: C++
Topic: compile error. help...
Replies: 4
Views: 2157

ANSI C++ Committee defined that the scope of such variable is the scope of 'for' itself. Before this new standard the scope was not defined and developers of compilers could do what they want. g++ and VC++(ver x) has different scoping for variables. For g++ the scope is till the closing brace of the...
by sumankar
Sat Mar 04, 2006 2:59 pm
Forum: Volume 109 (10900-10999)
Topic: 10990 - Another New Function
Replies: 32
Views: 15458

FAQ wrote:

Code: Select all

[...] scanf("%d\n", t);
should've been

Code: Select all

scanf( "%d\n", &t );

Go to advanced search