Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

c++ - Getting a past-the-end pointer -


possible duplicate:
take address of one-past-the-end array element via subscript: legal c++ standard or not?

const int n = ...; t a[n]; t* begin = &a[0]; //or t* end = begin + n; 

i know legal , fine. wondering if following undefined behavior or legal well. answer depend on type t?

t* end = &a[n]; 

p.s. question curiosity question, please refrain mentioning vector better alternative arrays , :)

yes. undefined behavior. no, type of t doesn't matter.

the accepted answer in linked duplicate in error own selection of standard citations. unfortunately muddles logic @ end come opposite conclusion. note in 3.9.2/3 contained within paragraph quite talking type, not ability dereference. type of pointer (array+size) same "as-if" there valid object of type t there; not mean there valid object there , in fact there isn't.

there citation in duplicate of c99 standard states &array[index] not result in pointer dereference implied array[index]. c99 not c++ though , i've not seen equivalent text says same thing. rule legal in c.

c++0x contain of c99, don't know if bit included. should not consider them same language.

most c++ compilers happily eat run compliant compiler not.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -