standards

Can sizeof(int) ever be 1 on a hosted implementation?

My view is that a C implementation cannot satisfy the specification of certain stdio functions (particularly fputc/fgetc) if sizeof(int)==1, since the int needs to be able to hold any possible value of unsigned char or EOF (-1). Is this reasoning correct? (Obviously sizeof(int) cannot be 1 if CHAR_BIT is 8, due to the minimum required r...

Which language was first to introduce the "in" keyword first: SQL or Object Pascal?

(Or possibly another language?) I know both SQL and Object Pascal first appeared in 1986, but I'm not sure which one had the in keyword first, so anyone who can point me to a definitive source will get my thanks and some reputation. Yes I searched for the answer, but I think my Google-fu is weak. :( ...

Kind of sparse initialization for structures, any resources?

Hi, I used to initialize my structures in this way: struct A a = {0}; This seems to work for me, however I was argued about ANSI C, C89, C99 standard. Simply I couldn't find that in any documentation. Could you help me with that? Here's an example that this works for 'cl' (VS express 2008). #include <stdio.h> struct DATA { i...

what will be the output & why

_ #include<stdio.h> int main() { int a=5,b=10; printf("%d %d"); return 0; } ...

Are there any standards similar to WSDL but designed for Java or C/C++?

Are there any standards similar to WSDL but designed for Java or C/C++? To be clear: I am designing an offline API, not a web service. I am designing a system that allows different components to be plugged in, but for the orchestrator to know how to call it I currently allow the orchestrator to retrieve back a sort of "get features" f...

Collection of standards in software development

Lets collect all together standards which are used in software development. I think we should follow this pattern: identification: [e.g.IEEE 123456789] title: [title in words] organisation: [organisation which released the standard] keywords: [e.g. area of the standard] description: [description as text date: [date or year it was relea...

javascript name vs ID

As far as I know there are two ways to get the value from a textbox either document.formName.textboxName.value; or document.getElementbyId('textboxId').value; As I understand using form name would mean I have less code to write, as name can be used for posting data and getting the value (apart from using ajax). As where if I was ju...

How many versions of standards are there in c++?

In C there're c89 and c99,what about c++? Is there any upgrade since it comes out? ...

How are standard libraries, tools and app server platforms typically selected in large organizations?

I'm looking for a list of criteria for selecting standard development libraries, tools, and application servers (specifically JEE) that is common across large organizations. If your experience doesn't span across multiple large orgs, answering with how this is conducted within your current org is still helpful. Also - 'standard' doesn't ...

Why were threads never included as part of the C++ standard?

Why is it that threads were never included as part of the C++ standard originally? Did they not exist when C++ standard was first created? ...

IEEE Double Precision

Standard IEEEDoublePrecision What is the largest and smallest number be displayed in the standard? how is it? ...

is this url unvalid and not good practice?

i have a url in this format: http://www.example.com/manchester united note the space between manchester and united, is this bad practice, or is it perfectly fine, i just wanted to before i proceed, thanks ...

Casting float inf to integer

What do you get in C from casting float +INF,-INF,NAN to integer? Does any standard specifies what should be the output? For example this code: #include <stdio.h> #include <math.h> int main(int argc, char** argv) { float a = INFINITY; float b = -INFINITY; float c = NAN; printf("float %f %f %f\n", a, b, c); printf("int %d %...

Are C++ Constructor delegates already available in VS2008?

Hello there SOers, I cant seem to find any useful information whether constructor delegates that are proposed for C++0x are already available in Visual Studio 2008 / 2010. I tried to use them and got pretty strange errors, but I can't test this in VS2010 currently. Can anyone tell me if they are available already? cheers, Tom ...

Amount to show on a bill form

My company is currently setting up an online billing portal for our customers. I was curious as this question went back and forth a bit between developers and testers: When showing the input form for the amount a customer wishes to pay, do you set the default to be the max amount owed by the customer? Taking a look around at sites when I...

In C is there any guarantee with code prior to undefined behavior?

In the following code is is guaranteed that "0\n" be printed? #include <stdio.h> int main(void) { int c = 0; printf("%d\n",c); printf("%d,%d\n",++c,++c); } More generally, if a program has undefined behavior does the entire program become undefined or only from the sequence point that begins the problematic code? Please...

What does ES5 refer to?

Hello everyone. I have been trying to understand what ES5 is and what does ES5-compliant really means but without much success. It's also true I didn't spend a lot of time trying to find the answer. Can anyone very briefly explain please? Thank you. ...

Why can't a multidimensional array be allocated with one new call in C++?

In C++ you can easily allocate one dimensional array like this: T *array=new T[N]; And you can delete it with one statement too: delete[] array; The compiler will know the magic how to deallocate the correct number of bytes. But why can't you alloc 2-dimensional arrays like this? T *array=new T[N,M]; Or even like this? T *arra...

Using regular expressions to find img tags without an alt attribute

Hi I am going through a large website (1600+ pages) to make it pass Priority 1 W3C WAI. As a result, things like image tags need to have alt attributes. What would be the regular expression for finding img tags without alt attributes? If possible, with a wee explanation so I can use to find other issues. I am in an office with Visua...

Onclick and on keypress for standards compliance

I am working on a large website (1600+ pages) that needs upgrading to pass standards compliance. As a result, for every OnClick there has to be, say the Standards, an OnKeyPress handler, so that people not using a mouse can still access the content. Some tags have an onclick javascript handler. EG: <a onclick="doSumat();"> Is the f...