level of questions for experts only

R

ROSY

hello,
response if u ,on all level of questions:::
1.how a self deletable .exe file deleted on some future date & time
without
invoking the .exe itself?
2.if we want that any wildcard characters in command line arguments
should be appropriately expanded,are we reqd. 2 make any special
provision?if yes,which?
3.why :: printf("%%%%%") ; output %%%.
4.how 2 run a .obj file without previously creating any .exe?
5.what is classical class?(FOR C++)

bye,
 
T

Tom Zych

ROSY said:
response if u ,on all level of questions:::

This means what, in English?
1.how a self deletable .exe file deleted on some future date & time
without
invoking the .exe itself?
2.if we want that any wildcard characters in command line arguments
should be appropriately expanded,are we reqd. 2 make any special
provision?if yes,which?
3.why :: printf("%%%%%") ; output %%%.
4.how 2 run a .obj file without previously creating any .exe?
5.what is classical class?(FOR C++)

Wow, not only for experts, but mostly for experts in other
newsgroups ;)

1, 2: Platform-specific; ask on a group for your platform.
4: Also platform-specific, but it sounds like you want to run
something that hasn't been linked, which I suspect can't be done.
5: You seem to be aware that this is a C++ question. Are you aware
that you asked it in comp.lang.c? We don't do C++ here.

3: '%' in the first argument to printf() starts a format specifier.
"%%" is the format specifier that means "print '%'". Apparently the
last one, being by itself at the end, also prints '%'; I don't know
if that's standard or just what your implementation does.
 
M

Mike Wahler

ROSY said:
hello,
response if u ,on all level of questions:::
1.how a self deletable .exe file deleted on some future date & time
without
invoking the .exe itself?

Not a question about C.
2.if we want that any wildcard characters in command line arguments
should be appropriately expanded,are we reqd. 2 make any special
provision?
Yes.

if yes,which?

Decide what you want each pattern to mean, and parse
accordingly.
3.why :: printf("%%%%%") ; output %%%.

Look up 'escape sequence' in a C book.
4.how 2 run a .obj file without previously creating any .exe?

Not a question about C.
5.what is classical class?(FOR C++)

Not a question about C. Nor does C++ have anything
called a 'classical class'.

Here's a question for you: Where's your textbook?

-Mike
 
I

Irrwahn Grausewitz

Tom Zych said:
ROSY wrote:

3: '%' in the first argument to printf() starts a format specifier.
"%%" is the format specifier that means "print '%'". Apparently the
last one, being by itself at the end, also prints '%'; I don't know
if that's standard or just what your implementation does.

IMO printf("%"); invokes undefined behaviour because it
consits of an invalid conversion specification, according
to ISO/IEC 9899:1999 7.19.6.1#9.

Regards

Irrwahn
 
G

goose

hello,
response if u ,on all level of questions:::
idiot!!!

1.how a self deletable .exe file deleted on some future date & time
without
invoking the .exe itself?
2.if we want that any wildcard characters in command line arguments
should be appropriately expanded,are we reqd. 2 make any special
provision?if yes,which?
3.why :: printf("%%%%%") ; output %%%.
4.how 2 run a .obj file without previously creating any .exe?
5.what is classical class?(FOR C++)

by now you should have realised that no one in this
group will do your homework for you. trying to engage
them with "expert" questions only further enrages the
regulars.

goose,
did you even read the faq for clc yet ?
 
J

Joona I Palaste


Seconded. You (ROSY) should also invest in a readable writing style and
not h4x0r d00d l33tsp33k like this.
I'll rewrite your questions like they would have been posed by a sane
person.

Hello, respond if you are on all level of questions.

How can a self-deletable .exe file delete itself on some future date
and time without invoking the .exe file itself?

If we want any wildcard characters in command line arguments to be
appropriately expanded, are we required to make any special provision?
If yes, which?

Why printf("%%%%%"); outputs %%%?

How to run a .obj file without previously creating any .exe file?

What is a classical class? (For C++)

Most important rules:
1) It's "you". Y-O-U. "U" is not a pronoun, it's a letter. Furthermore,
"ur" is a German prefix. In English we write "your" or "you're". No
points deducted for confusing the two, native speakers also often do.
2) Numbers are numbers, words are words, and never the twain shall
meet. "Words" like "2" for "to" and "4" for "four" belong to 12-year-
old script kiddies.
3) Use proper capitalisation. The first letter of the first word of
a sentence should be capitalised. In other words, do not write like
e.e.cummings.
4) Question sentences should end in a question mark. ONE question
mark. Not like "can U help me plz?????????????????????????????????????".
Yes, you guessed it, "plz" is also out. Write "please". And on the off
chance you should ever receive a real answer (which would require a
real question in the first place), say "thanks", not "thx".

That should cover the most of the lot.

--
/-- Joona Palaste ([email protected]) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"Shh! The maestro is decomposing!"
- Gary Larson
 
J

Joona I Palaste

Joona I Palaste said:
2) Numbers are numbers, words are words, and never the twain shall
meet. "Words" like "2" for "to" and "4" for "four" belong to 12-year-
old script kiddies.

That should be "4" for "for", natch.

--
/-- Joona Palaste ([email protected]) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"You will be given the plague."
- Montgomery Burns
 
D

Dan Pop

In said:
Look up 'escape sequence' in a C book.

Huh?!? Can't see any escape sequence in this format string. And the
effect of the 5th '%' sign can't be explained by any C book, being
undefined.

Dan
 
J

John Bode

hello,
response if u ,on all level of questions:::
1.how a self deletable .exe file deleted on some future date & time
without
invoking the .exe itself?

This is not a question about the C programming language.

Let me get this straight. You have an executable that deletes itself.
You want this executable to delete itself at some future time, but
without invoking the executable?

If you don't actually run the program, how can it be expected to
delete itself?
2.if we want that any wildcard characters in command line arguments
should be appropriately expanded,are we reqd. 2 make any special
provision?if yes,which?

If the shell from which you invoked the program does not expand
wildcards for you, you will have to expand those wildcards manually.
How you do so depends on what utilities are available to you. There's
no facility in the standard library that I'm aware of that will do
this for you. Otherwise, I'm not sure what you mean by special
provision.
3.why :: printf("%%%%%") ; output %%%.

This should be answered in your handy C reference manual (H&S4, p378;
K&R2, p244).

I will remind you again that this newsgroup is not meant to be a
substitute for a good reference manual.
4.how 2 run a .obj file without previously creating any .exe?

This is not a question about C, but about how your particular
compiler/linker/platform combination produce executable code.

FWIW, on most platforms I'm familiar with, you can't run the .obj file
directly.
5.what is classical class?(FOR C++)

This question should be answered by your handy C++ reference manual.
 
C

Christopher Benson-Manica

Irrwahn Grausewitz said:
IMO printf("%"); invokes undefined behaviour because it
consits of an invalid conversion specification, according
to ISO/IEC 9899:1999 7.19.6.1#9.

Why is the compiler allowed to compile this? In other words, why mustn't it
interpret the %" as a conversion specifier and consequently inform you about
an unterminated string constant?

(FWIW, gcc warns about "spurious trailing '%' in format.")
 
J

Jack Klein

Why is the compiler allowed to compile this? In other words, why mustn't it
interpret the %" as a conversion specifier and consequently inform you about
an unterminated string constant?

(FWIW, gcc warns about "spurious trailing '%' in format.")

There is no unterminated string constant. String literals are
converted to unnamed arrays of char by the compiler, which cares
nothing at all for the '%' character. The only character that matters
to the compiler in a string literal is '\'.

Some compilers have options to check the format string against the
arguments at compile time, but this is not required by the standard.
Passing a mis-match list of arguments to printf() at run time is just
plain undefined behavior, as Irrwahn quoted, and an implementation is
NEVER required to diagnose undefined behavior.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
 
I

Irrwahn Grausewitz

Christopher Benson-Manica said:
Why is the compiler allowed to compile this? In other words, why mustn't it
interpret the %" as a conversion specifier and consequently inform you about
an unterminated string constant?

The standard doesn't require diagnostics in case of UB.
Once UB is invoked, the implementation is free to do whatever it likes.
You'd better not run the above code on a DS9000.
(FWIW, gcc warns about "spurious trailing '%' in format.")

That's nice of it, isn't it? :)

Irrwahn
 
B

Bertrand Mollinier Toublet

Joona said:
Seconded. You (ROSY) should also invest in a readable writing style and
not h4x0r d00d l33tsp33k like this.
I'll rewrite your questions like they would have been posed by a sane
person.

Hello, respond if you are on all level of questions.
That still doesn't make sense to me. Either I am missing something or
you didn't quite achieve what you said you would ("rewrite the questions
as would have been posed by a sane person").
Why printf("%%%%%"); outputs %%%?
Ah, I don't think so. Maybe you should avoid treading on such slippery
slopes. When correcting someone's language (be it English or C), you
will agree that you have to be spotless (and this is actually why most
spelling and grammar newsgroups are such flame fields). That would at
the very least (not considering how to gracefully mix code and English) be:

Why does printf("%%%%%"); output %%%?
In English we write "your" or "you're". No
points deducted for confusing the two, native speakers also often do.

I will certainly not agree with that. The difference between "your" and
"you're", as between "its" and "it's" or between "they're" and "their"
is not all that subtle. Allowing some phonetic switching but forbidding
other (as you do below) is plain hypocrisy.
 
K

Keith Thompson

Christopher Benson-Manica said:
Why is the compiler allowed to compile this? In other words, why mustn't it
interpret the %" as a conversion specifier and consequently inform you about
an unterminated string constant?

(FWIW, gcc warns about "spurious trailing '%' in format.")

The format string is interpreted at run time, not at compilation time.
For example:

char *s = some_func(); # happens to return "%"
printf(s);

Since there's no opportunity in the general case to check this during
compilation, the compiler isn't required to check it in the special
case of passing a string literal. It's good that gcc gives a warning,
but it's not required to.
 
M

Mark McIntyre

On 25 Sep 2003 20:15:22 -0700, in comp.lang.c ,
hello,
response if u ,on all level of questions:::
1.how a self deletable .exe file deleted on some future date & time
without invoking the .exe itself?

This is not a C question. Please ask it again in a group specialising
in your operating system as it is specific to that. You've already
been told this by the way.
2.if we want that any wildcard characters in command line arguments
should be appropriately expanded,are we reqd. 2 make any special
provision?if yes,which?

Expanded to what? If you want to expand wildcards, write some code.
3.why :: printf("%%%%%") ; output %%%.

it doesnt, it prints %%. This is because each %% is converted to a %,
and the stray lonely % at the end is ignored.
4.how 2 run a .obj file without previously creating any .exe?

This is not a C question. Please ask it again in a group specialising
in your operating system but be aware that its not even a meaningful
question for most OSen. Its akin to saying "how can I use my computer
without previously connecting the parts together?"
5.what is classical class?(FOR C++)

This is not a C question. Please ask it again in a C++ group
 
I

Irrwahn Grausewitz

Mark McIntyre said:
On 25 Sep 2003 20:15:22 -0700, in comp.lang.c ,
(e-mail address removed) (ROSY) wrote:


it doesnt, it prints %%. This is because each %% is converted to a %,
and the stray lonely % at the end is ignored.

No. It invokes undefined behaviour. Your implementation may stop
translation, issue a diagnostic, print %%%, print %%, print "Strength is
irrelevant, resistance is futile!" and assimilate you, transfer all your
money to my bank account, nuke Labrador, or whatever.

<SNIP>

Irrwahn
 
M

Mike Wahler

Peter Nilsson said:
A constraint violation requires a diagnostic.

Correct, but to which constraint violation do you refer?

Undefined behavior and constraint violations are not the
same thing (see 5.1.1.3 below), which specifically
distinguishes between them.

============

ISO/IEC 9899:1999 (E)

3. Terms, definitions, and symbols

[...]

3.4.3

1 undefined behavior

behavior, upon use of a nonportable or erroneous program
construct or of erroneous data, for which this International
Standard imposes no requirements

2 NOTE Possible undefined behavior ranges from ignoring the
situation completely with unpredictable results, to behaving
during translation or program execution in a documented manner
characteristic of the environment (with or without the issuance
of a diagnostic message), to terminating a translation or
execution (with the issuance of a diagnostic message).

3 EXAMPLE An example of undefined behavior is the behavior on
integer overflow.

[...]

3.8

1 constraint

restriction, either syntactic or semantic, by which the
exposition of language elements is to be interpreted

[...]

5.1.1.3 Diagnostics

1 A conforming implementation shall produce at least one diagnostic
message (identified in an implementation-defined manner) if a
preprocessing translation unit or translation unit contains a
violation of any syntax rule or constraint, even if the behavior
is also explicitly specified as undefined or implementation-defined.
Diagnostic messages need not be produced in other circumstances.(8)

2 EXAMPLE An implementation shall issue a diagnostic for the
translation unit:

char i;
int i;

because in those cases where wording in this International Standard
describes the behavior for a construct as being both a constraint
error and resulting in undefined behavior, the constraint error shall
be diagnosed.

[...]

(8) The intent is that an implementation should identify the nature
of, and where possible localize, each violation. Of course, an
implementation is free to produce any number of diagnostics as long
as a valid program is still correctly translated. It may also
successfully translate an invalid program.

============


-Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top