Concerning program startup in a hosted environment, both C90 and C99 require
that the implementation provide main's ``argv'' strings in lowercase if the
host environment is not capable of supply both uppercase and lowercase
letters.
While I hesitate to mention any specific platform in this query -- presuming
such an implementation capable of only uppercase letters, what is the
reason for the C language's ensuring that the strings, if any, be
represented in lowercase form (as opposed to the hosted environment's
``native'' form of letters)?
Or have I perhaps misunderstood this particular ``shall ensure'' portion of
5.1.2.2.1 about ``Program startup''? 2 2077
In article <g2**********@r enpen.nelsonbe. com>,
Bob Nelson <bn*****@nelson be.comwrote:
>Concerning program startup in a hosted environment, both C90 and C99 require that the implementation provide main's ``argv'' strings in lowercase if the host environment is not capable of supply both uppercase and lowercase letters.
>While I hesitate to mention any specific platform in this query -- presuming such an implementation capable of only uppercase letters, what is the reason for the C language's ensuring that the strings, if any, be represented in lowercase form (as opposed to the hosted environment's ``native'' form of letters)?
There is no way provided to query what the hosted environment's
"native" form of letters (as you put it) is, so it would not be possible
to tell whether the inputs are all uppercase because the user
typed them in all uppercase or because that's the native environment.
To deal with this situation, the standards committee had to choose
either all upper-case or all lower-case. Probably they followed
existing precident.
--
"The slogans of an inadequate criticism peddle ideas to fashion"
-- Walter Benjamin
Bob Nelson <bn*****@nelson be.comwrote:
>
While I hesitate to mention any specific platform in this query -- presuming
such an implementation capable of only uppercase letters, what is the
reason for the C language's ensuring that the strings, if any, be
represented in lowercase form (as opposed to the hosted environment's
``native'' form of letters)?
History. Traditionally, C code that was intended to be portable used a
command line format based on the Unix standard, which implies lower-case
options.
-- Larry Jones
That gives me a FABULOUS idea. -- Calvin This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Steven T. Hatton |
last post by:
This is a purely *hypothetical* question. That means, it's /pretend/,
CP. ;-)
If you were forced at gunpoint to put all your code in classes, rather than
in namespace scope (obviously classes themselves are an exception to this),
and 'bootstrap' your program by instantiating a single application object
in main(), would that place any limitations on what you could accomplish
with your program? Are there any benefits to doing things that...
|
by: qazmlp |
last post by:
void func()
{
// Is it by anyway possible to read the value of the first command
line parameter i.e. argv here ?
}
int main()
{
func() ; // No command line arguments are passed to func().
}
|
by: Stephen Mayes |
last post by:
Correct me if I am mistaken.
The C standard guarantees that in a C hosted environment we can define main
as:
int main( int argc, char *argv ).
I always assume that 'argc' is the number of pointers in the array 'argv'
and that the pointers in 'argv' point to null-terminated strings, and that
those strings represent a command line.
Is this always the case?
|
by: Bill Cunningham |
last post by:
> #include <stdlib.h>
> #include <stdio.h>
>
> int main(int argc, char *argv) {
> FILE *in, *out;
>
> if(argc==1)
> {
> in = stdin;
> out = stdout;
|
by: Bill Cunningham |
last post by:
I've read that the only parameters that main takes other than a void is this
main(int argc,char *argv)
I may be correct on this.
I want to take from the command line prompt 2 doubles, pass the values
stored in the array to another function which does some calculations and
returns the address of doubles to the main function.
rel.c /* name of source */
#include "main.h"
| |
by: Joe Smith |
last post by:
It is nothing short of embarrassing to feel the need to ask for help on
this. I can't see how I would make the main control for this. What I want
is a for loop and a test condition. And while I know, from things I
pondered 2 decades ago, that a fella can write code without a goto, I'm
stuck.
/* sieve1.c */
#define whatever 20
#define N whatever
|
by: interec |
last post by:
Hi Folks,
I am writing a c++ program on redhat linux using main(int argc,
wchar_t *argv). $LANG on console is set to "en_US.UTF-8". g++
compiler version is 3.4.6.
Q1. what is the encoding of data that I get in argv ?
Q2. what is encoding of string constants defined in programs (for
example L"--count") ?
|
by: arnuld |
last post by:
i am not able to figure out the error:
/* C++ Primer - 4/e
*
* exercise 7.16
* STATEMENT:
* write a programme that accepts the arguments to main. print
* the values passed to main.
*
*/
|
by: Rahul |
last post by:
Hi Everyone,
I have seen code in different styles like
main(argc,argv)
int argc;
char **argv;
{
if(argc != 2) exit(1);
else exit(0);
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |