C++ new int[0] — will it allocate memory?
A simple test app: cout << new int[0] << endl; outputs: 0x876c0b8 So it looks like it works. What does the standard say about this? Is it always legal to “allocate” empty block of memory? 6 Answers 6
A simple test app: cout << new int[0] << endl; outputs: 0x876c0b8 So it looks like it works. What does the standard say about this? Is it always legal to “allocate” empty block of memory? 6 Answers 6
Example: Is the following code valid against the JSON Spec? { precision: “zip” } Or should I always use the following syntax? (And if so, why?) { “precision”: “zip” } I haven’t really found something about this in the JSON specifications. Although they use quotes around their keys in their examples. 7 Answers 7
I understand that an id must be unique within an HTML/XHTML page. For a given element, can I assign multiple ids to it? <div id=”nested_element_123 task_123″></div> I realize I have an easy solution with simply using a class. I’m just curious about using ids in this manner. 18 Answers 18
Is it valid html to have the following: <form action=”a”> <input…/> <form action=”b”> <input…/> <input…/> <input…/> </form> <input…/> </form> So when you submit “b” you only get the fields within the inner form. When you submit “a” you get all fields minus those within “b”. If it isn’t possible, what workarounds for this situation are … Read more
After reading Hidden Features and Dark Corners of C++/STL on comp.lang.c++.moderated, I was completely surprised that the following snippet compiled and worked in both Visual Studio 2008 and G++ 4.4. Here’s the code: #include <stdio.h> int main() { int x = 10; while (x –> 0) // x goes to 0 { printf(“%d “, x); … Read more