473,383 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

appropriate caller and print specifier

/* C version */
static unsigned long
t,x=123456789,y=362436069,z=21288629,w=14921776,c= 0;
unsigned long KISS(){
x+=545925293;
y^=(y<<13); y^=(y>>17); y^=(y<<5);
t=z+w+c; z=w; c=(t>>31); w=t&2147483647;
return(x+y+w); }
What would be an appropriate caller for this function. Am I correct
that the static specifier has the function remembering its older
variables?
unsigned long function(void)
#include <stdio.h>
int main(void)
{
unsigned long g;
g=KISS();
printf("%lu\n", g); /*looks close*/
return 0;
}
--
Wade Ward

Jun 26 '07 #1
16 1781
On Jun 26, 2:47 pm, Wade Ward <zaxf...@gmail.comwrote:
/* C version */
static unsigned long
t,x=123456789,y=362436069,z=21288629,w=14921776,c= 0;
unsigned long KISS(){
x+=545925293;
y^=(y<<13); y^=(y>>17); y^=(y<<5);
t=z+w+c; z=w; c=(t>>31); w=t&2147483647;
return(x+y+w); }
What would be an appropriate caller for this function. Am I correct
that the static specifier has the function remembering its older
variables?
unsigned long function(void)
#include <stdio.h>
int main(void)
{
unsigned long g;
g=KISS();
printf("%lu\n", g); /*looks close*/
return 0;}

--
Wade Ward
/* C version */
static unsigned long
t,
x = 123456789,
y = 362436069,
z = 21288629,
w = 14921776,
c = 0;
unsigned long KISS()
{
x += 545925293;
y ^= (y << 13);
y ^= (y >17);
y ^= (y << 5);
t = z + w + c;
z = w;
c = (t >31);
w = t & 2147483647;
return (x + y + w);
}
/* What would be an appropriate caller for this function?
================================================== ===========
Any caller needing its output, provided there is a single
thread of execution. This function modifies static data
and is therefore not reentrant.
================================================== ===========
Am I correct that the static specifier has the function
remembering its older variables?
================================================== ===========
>From the ANSI/ISO C Standard ©ISO/IEC ISO/IEC 9899:1999 (E):
"5.1.2 Execution environments
1 Two execution environments are defined: freestanding and hosted. In
both cases, program startup occurs when a designated C function is
called by the execution environment. All objects with static storage
duration shall be initialized (set to their initial values) before
program startup. The manner and timing of such initialization are
otherwise unspecified. Program termination returns control to the
execution environment."

"6.2.4 Storage durations of objects
1 An object has a storage duration that determines its lifetime. There
are three storage durations: static, automatic, and allocated.
Allocated storage is described in 7.20.3.
2 The lifetime of an object is the portion of program execution during
which storage is guaranteed to be reserved for it. An object exists,
has a constant address,25) and retains its last-stored value
throughout its lifetime.26) If an object is referred to outside of its
lifetime, the behavior is undefined. The value of a pointer becomes
indeterminate when the object it points to reaches the end of its
lifetime.
3 An object whose identifier is declared with external or internal
linkage, or with the storage-class specifier static has static storage
duration. Its lifetime is the entire execution of the program and its
stored value is initialized only once, prior to program startup.
4 An object whose identifier is declared with no linkage and without
the storage-class specifier static has automatic storage duration."
================================================== ===========
*/

#include <stdio.h>
int main(void)
{
unsigned long g;
g = KISS();
printf("%lu\n", g); /* looks close */
return 0;
}

Jun 26 '07 #2
On Tue, 26 Jun 2007 21:47:43 -0000, Wade Ward <za*****@gmail.com>
wrote:
>/* C version */
static unsigned long
t,x=123456789,y=362436069,z=21288629,w=14921776,c =0;
If you want help, the least you could do is try to make your code
readable. Horizontal whitespace and indenting do not increase your
message cost.
>unsigned long KISS(){
x+=545925293;
y^=(y<<13); y^=(y>>17); y^=(y<<5);
t=z+w+c; z=w; c=(t>>31); w=t&2147483647;
return(x+y+w); }
What would be an appropriate caller for this function. Am I correct
If you mean calling statement, then the one you have below is
adequate. You could call KISS in any statement where an expression of
type unsigned long would be allowed.
>that the static specifier has the function remembering its older
variables?
The static qualifier means
1 - The objects are created and initialized only once when
your program (not function) starts.
2 - The object remain "alive" for the duration of your program
(not function).

These two statement lead to the conclusion that the only way any of
these objects change value is via an executable statement. Since you
never pass the address of any of these variables to another function
(the only way another function could access them), the values will
remain unchanged between successive calls to KISS.
>unsigned long function(void)
What did you intend for this statement?
>#include <stdio.h>
int main(void)
{
unsigned long g;
g=KISS();
printf("%lu\n", g); /*looks close*/
Is your question about calling KISS or printing it\0 return value?
>return 0;
}

Remove del for email
Jun 27 '07 #3
Barry Schwarz wrote:
Wade Ward <za*****@gmail.comwrote:
.... snip ...
>
>that the static specifier has the function remembering its older
variables?

The static qualifier means
1 - The objects are created and initialized only once when
your program (not function) starts.
2 - The object remain "alive" for the duration of your program
(not function).
Not if applied to a function.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

Jun 27 '07 #4
On Tue, 26 Jun 2007 23:27:25 -0400, CBFalconer <cb********@yahoo.com>
wrote:
>Barry Schwarz wrote:
>Wade Ward <za*****@gmail.comwrote:
... snip ...
>>
>>that the static specifier has the function remembering its older
variables?

The static qualifier means
1 - The objects are created and initialized only once when
your program (not function) starts.
2 - The object remain "alive" for the duration of your program
(not function).

Not if applied to a function.
Last time I looked, functions were not objects.
Remove del for email
Jun 27 '07 #5
Barry Schwarz wrote:
CBFalconer <cb********@yahoo.comwrote:
>Barry Schwarz wrote:
>>Wade Ward <za*****@gmail.comwrote:
... snip ...
>>>
that the static specifier has the function remembering its older
variables?

The static qualifier means
1 - The objects are created and initialized only once when
your program (not function) starts.
2 - The object remain "alive" for the duration of your program
(not function).

Not if applied to a function.

Last time I looked, functions were not objects.
So? This is about functions, not objects. You injected objects.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

Jun 27 '07 #6
On Wed, 27 Jun 2007 07:17:45 -0400, CBFalconer <cb********@yahoo.com>
wrote:
>Barry Schwarz wrote:
>CBFalconer <cb********@yahoo.comwrote:
>>Barry Schwarz wrote:
Wade Ward <za*****@gmail.comwrote:

... snip ...

that the static specifier has the function remembering its older
variables?

The static qualifier means
1 - The objects are created and initialized only once when
your program (not function) starts.
2 - The object remain "alive" for the duration of your program
(not function).

Not if applied to a function.

Last time I looked, functions were not objects.

So? This is about functions, not objects. You injected objects.
No it wasn't and I didn't. You looked at the question without looking
at the code it referred to.

If you look at the text which I quoted in my response to the original
poster, the static qualifier was applied to the definition of a bunch
of unsigned long variables. The signature of the function was simply
unsigned long with no static.
Remove del for email
Jun 27 '07 #7
On Jun 26, 9:39 pm, Barry Schwarz <schwa...@doezl.netwrote:
On Tue, 26 Jun 2007 21:47:43 -0000, Wade Ward <zaxf...@gmail.com>
wrote:
/* C version */
static unsigned long
t,x=123456789,y=362436069,z=21288629,w=14921776,c= 0;

If you want help, the least you could do is try to make your code
readable. Horizontal whitespace and indenting do not increase your
message cost.
unsigned long KISS(){
x+=545925293;
y^=(y<<13); y^=(y>>17); y^=(y<<5);
t=z+w+c; z=w; c=(t>>31); w=t&2147483647;
return(x+y+w); }
What would be an appropriate caller for this function. Am I correct

If you mean calling statement, then the one you have below is
adequate. You could call KISS in any statement where an expression of
type unsigned long would be allowed.
that the static specifier has the function remembering its older
variables?

The static qualifier means
1 - The objects are created and initialized only once when
your program (not function) starts.
2 - The object remain "alive" for the duration of your program
(not function).

These two statement lead to the conclusion that the only way any of
these objects change value is via an executable statement. Since you
never pass the address of any of these variables to another function
(the only way another function could access them), the values will
remain unchanged between successive calls to KISS.
unsigned long function(void)

What did you intend for this statement?
Thanks for your reply. I intended this to be the declaration of the
function KISS. Since I omitted KISS altogether, it looks wrong. Is
this better?
unsigned long function KISS(void)
>
#include <stdio.h>
int main(void)
{
unsigned long g;
g=KISS();
printf("%lu\n", g); /*looks close*/

Is your question about calling KISS or printing its return value?
I think a caller has to call the right type and display its value in
main. So yes.
--
Wade Ward

Jun 27 '07 #8
On Jun 27, 2:58 pm, Wade Ward <zaxf...@gmail.comwrote:
On Jun 26, 9:39 pm, Barry Schwarz <schwa...@doezl.netwrote:
On Tue, 26 Jun 2007 21:47:43 -0000, Wade Ward <zaxf...@gmail.com>
wrote:
>/* C version */
>static unsigned long
>t,x=123456789,y=362436069,z=21288629,w=14921776,c =0;
If you want help, the least you could do is try to make your code
readable. Horizontal whitespace and indenting do not increase your
message cost.
>unsigned long KISS(){
>x+=545925293;
>y^=(y<<13); y^=(y>>17); y^=(y<<5);
>t=z+w+c; z=w; c=(t>>31); w=t&2147483647;
>return(x+y+w); }
>What would be an appropriate caller for this function. Am I correct
If you mean calling statement, then the one you have below is
adequate. You could call KISS in any statement where an expression of
type unsigned long would be allowed.
>that the static specifier has the function remembering its older
>variables?
The static qualifier means
1 - The objects are created and initialized only once when
your program (not function) starts.
2 - The object remain "alive" for the duration of your program
(not function).
These two statement lead to the conclusion that the only way any of
these objects change value is via an executable statement. Since you
never pass the address of any of these variables to another function
(the only way another function could access them), the values will
remain unchanged between successive calls to KISS.
>unsigned long function(void)
What did you intend for this statement?

Thanks for your reply. I intended this to be the declaration of the
function KISS. Since I omitted KISS altogether, it looks wrong. Is
this better?
unsigned long function KISS(void)
Lose the word 'function'. You want:
unsigned long KISS(void);

It is not strictly necessary if the function body precedes its use.
>#include <stdio.h>
>int main(void)
>{
>unsigned long g;
>g=KISS();
>printf("%lu\n", g); /*looks close*/
Is your question about calling KISS or printing its return value?

I think a caller has to call the right type and display its value in
main. So yes.
A function should have a correct prototype in scope when it is
called. Quite often, that bit will allow the compiler to do whatever
conversions are required.
I can't really parse your sentences above very well.

Jun 28 '07 #9
On Wed, 27 Jun 2007 21:58:32 -0000, Wade Ward <za*****@gmail.com>
wrote:
>On Jun 26, 9:39 pm, Barry Schwarz <schwa...@doezl.netwrote:
>On Tue, 26 Jun 2007 21:47:43 -0000, Wade Ward <zaxf...@gmail.com>
wrote:
snip
>unsigned long function(void)

What did you intend for this statement?
Thanks for your reply. I intended this to be the declaration of the
function KISS. Since I omitted KISS altogether, it looks wrong. Is
this better?
unsigned long function KISS(void)
Well, you are getting closer. Delete the word "function" and add a
semicolon and you will have it.

Remove del for email
Jun 28 '07 #10

"user923005" <dc*****@connx.comwrote in message
news:11**********************@n60g2000hse.googlegr oups.com...
On Jun 27, 2:58 pm, Wade Ward <zaxf...@gmail.comwrote:
>On Jun 26, 9:39 pm, Barry Schwarz <schwa...@doezl.netwrote:
On Tue, 26 Jun 2007 21:47:43 -0000, Wade Ward <zaxf...@gmail.com>
wrote:
>/* C version */
static unsigned long
t,x=123456789,y=362436069,z=21288629,w=14921776,c =0;
If you want help, the least you could do is try to make your code
readable. Horizontal whitespace and indenting do not increase your
message cost.
>unsigned long KISS(){
x+=545925293;
y^=(y<<13); y^=(y>>17); y^=(y<<5);
t=z+w+c; z=w; c=(t>>31); w=t&2147483647;
return(x+y+w); }
What would be an appropriate caller for this function. Am I correct
If you mean calling statement, then the one you have below is
adequate. You could call KISS in any statement where an expression of
type unsigned long would be allowed.
>that the static specifier has the function remembering its older
variables?
The static qualifier means
1 - The objects are created and initialized only once when
your program (not function) starts.
2 - The object remain "alive" for the duration of your program
(not function).
These two statement lead to the conclusion that the only way any of
these objects change value is via an executable statement. Since you
never pass the address of any of these variables to another function
(the only way another function could access them), the values will
remain unchanged between successive calls to KISS.
>unsigned long function(void)
What did you intend for this statement?

Thanks for your reply. I intended this to be the declaration of the
function KISS. Since I omitted KISS altogether, it looks wrong. Is
this better?
unsigned long function KISS(void)

Lose the word 'function'. You want:
unsigned long KISS(void);

It is not strictly necessary if the function body precedes its use.
>#include <stdio.h>
int main(void)
{
unsigned long g;
g=KISS();
printf("%lu\n", g); /*looks close*/
Is your question about calling KISS or printing its return value?

I think a caller has to call the right type and display its value in
main. So yes.

A function should have a correct prototype in scope when it is
called. Quite often, that bit will allow the compiler to do whatever
conversions are required.
I can't really parse your sentences above very well.
I think I was trying to say that a proper caller has the correct prototype
in scope, and--this is my own thing-- it prints out the value that it
requisitioned. I'm less interested in writing my own stuff in C nowadays,
but I don't want to get so rusty that I can't call somebody else's. My
compiler is giving me a cool one hundred errors right now for the following.
unsigned long KISS(void)
#include <stdio.h>
int main(void)
{
unsigned long g;

static unsigned long t,x=123456789,y=362436069,z=21288629,w=14921776,c= 0;
g=KISS();
printf("%lu\n", g);
return 0;
}

unsigned long KISS(){
x+=545925293;
y^=(y<<13); y^=(y>>17); y^=(y<<5);
t=z+w+c; z=w; c=(t>>31); w=t&2147483647;
return(x+y+w); }
! end source
This is my first error:
6 C:\Dev-Cpp\include\stddef.h:6, from
C:\Dev-Cpp\include\stddef.h In file included from
C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/stddef.h:6,
from C:/Dev-Cpp/include/stddef.h
Is my compiler unable to find stdio.h ?
--
Wade Ward
Jun 29 '07 #11
"Wade Ward" <in*****@invalid.nyetwrites:
[...]
My compiler is giving me a cool one hundred errors right now for the
following.
unsigned long KISS(void)
#include <stdio.h>
int main(void)
{
unsigned long g;

static unsigned long t,x=123456789,y=362436069,z=21288629,w=14921776,c= 0;
g=KISS();
printf("%lu\n", g);
return 0;
}

unsigned long KISS(){
x+=545925293;
y^=(y<<13); y^=(y>>17); y^=(y<<5);
t=z+w+c; z=w; c=(t>>31); w=t&2147483647;
return(x+y+w); }
! end source
This is my first error:
6 C:\Dev-Cpp\include\stddef.h:6, from
C:\Dev-Cpp\include\stddef.h In file included from
C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../../include/stddef.h:6,
from C:/Dev-Cpp/include/stddef.h
Is my compiler unable to find stdio.h ?
No, it's unable to process the declarations in stdio.h because you've
introduced a syntax error before the #include directive.

When you post code, please Please PLEASE indent it properly. It makes
it much easier to read. (Sometimes tab characters are mangled by
Usenet software; use spaces for indentation if at all possible.)
Judicious use of whitespace around operators is also very helpful.

Here's a copy of your code with whitespace added, and with no other
changes:

unsigned long KISS(void)
#include <stdio.h>
int main(void)
{
unsigned long g;

static unsigned long t, x = 123456789, y = 362436069, z = 21288629,
w = 14921776, c = 0;
g = KISS();
printf("%lu\n", g);
return 0;
}

unsigned long KISS()
{
x += 545925293;
y ^= (y<<13); y ^= (y>>17); y ^= (y<<5);
t = z + w + c; z = w; c = (t>>31); w = t&2147483647;
return (x + y + w);
}

Now take a look at your first line. There's a missing semicolon.
Declarations can span multiple lines, so as far as the compiler knows,
you just haven't finished the declaration yet; it continues looking
for a valid completion *in stdio.h*. Obviously it doesn't find one,
but it keeps looking until it can prove that there's an error. (It's
legal, but pretty much never a good idea, to begin a declaration in
one file and complete it in a nested include file.) A really smart
compiler might have guessed that the problem is the missing s

Also, your #include directives should always precede any of your own
code.

The trailing '}' of your KISS function is on the same line as the return
statement. Put it on a line by itself.

The name KISS is a poor choice; all-caps identifiers are
conventionally reserved for macros.

The prototype for KISS is inconsistent with the declaration;
unsigned long KISS(void)
and
unsigned long KISS()
mean different things.

When I fix the missing semicolon and move the #include directive to
the top of the file, I get complaints that x, y, z, t, w, and c are
undeclared in KISS. You declared these variables in main; they're not
visible in KISS. (Declaring them "static" affects their lifetime, not
their visibility.)

Since these variables are only used inside KISS, why not declare them
there?

I haven't a clue what your program is supposed to do, so I can't guess
whether it's correct or not.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 29 '07 #12

"user923005" <dc*****@connx.comwrote in message
news:11**********************@n60g2000hse.googlegr oups.com...

A function should have a correct prototype in scope when it is
called. Quite often, that bit will allow the compiler to do whatever
conversions are required.
I can't really parse your sentences above very well.
unsigned long KISS(void);
static unsigned long t, x=123456789, y=362436069, z=21288629,
w=14921776, c=0;

#include <stdio.h>
int main(void){
unsigned long g, i;
for (i=1;i<=100000;++i)
{
g=KISS();
if(i 99996){
printf("%lu %lu\n",i, g);
}
}
// system("pause");
return 0;
}

unsigned long KISS(){
x+=545925293;
y^=(y<<13); y^=(y>>17); y^=(y<<5);
t=z+w+c; z=w; c=(t>>31); w=t&2147483647;
return(x+y+w);
}
This seems to work. I think my variables were at the wrong scope. Thanks
for your help.
--
WW
Jun 29 '07 #13
On Fri, 29 Jun 2007 18:52:43 -0400, "Wade Ward" <in*****@invalid.nyet>
wrote:
>
"user923005" <dc*****@connx.comwrote in message
news:11**********************@n60g2000hse.googleg roups.com...

>A function should have a correct prototype in scope when it is
called. Quite often, that bit will allow the compiler to do whatever
conversions are required.
I can't really parse your sentences above very well.
unsigned long KISS(void);
static unsigned long t, x=123456789, y=362436069, z=21288629,
w=14921776, c=0;

#include <stdio.h>
int main(void){
unsigned long g, i;
for (i=1;i<=100000;++i)
{
g=KISS();
if(i 99996){
printf("%lu %lu\n",i, g);
}
}
// system("pause");
return 0;
}

unsigned long KISS(){
x+=545925293;
y^=(y<<13); y^=(y>>17); y^=(y<<5);
t=z+w+c; z=w; c=(t>>31); w=t&2147483647;
return(x+y+w);
}
This seems to work. I think my variables were at the wrong scope. Thanks
for your help.
All the static unsigned longs can (should) be placed in KISS.
Remove del for email
Jun 29 '07 #14

"Barry Schwarz" <sc******@doezl.netwrote in message
news:ku********************************@4ax.com...
On Fri, 29 Jun 2007 18:52:43 -0400, "Wade Ward" <in*****@invalid.nyet>
wrote:
>>
"user923005" <dc*****@connx.comwrote in message
news:11**********************@n60g2000hse.google groups.com...

>>A function should have a correct prototype in scope when it is
called. Quite often, that bit will allow the compiler to do whatever
conversions are required.
I can't really parse your sentences above very well.
unsigned long KISS(void);
static unsigned long t, x=123456789, y=362436069, z=21288629,
w=14921776, c=0;

#include <stdio.h>
int main(void){
unsigned long g, i;
for (i=1;i<=100000;++i)
{
g=KISS();
if(i 99996){
printf("%lu %lu\n",i, g);
}
}
// system("pause");
return 0;
}

unsigned long KISS(){
x+=545925293;
y^=(y<<13); y^=(y>>17); y^=(y<<5);
t=z+w+c; z=w; c=(t>>31); w=t&2147483647;
return(x+y+w);
}
This seems to work. I think my variables were at the wrong scope. Thanks
for your help.

All the static unsigned longs can (should) be placed in KISS.
....else why the static modifier?
--
Jun 29 '07 #15
On Fri, 29 Jun 2007 19:49:57 -0400, "Wade Ward" <in*****@invalid.nyet>
wrote:
>
"Barry Schwarz" <sc******@doezl.netwrote in message
news:ku********************************@4ax.com.. .
>On Fri, 29 Jun 2007 18:52:43 -0400, "Wade Ward" <in*****@invalid.nyet>
wrote:
>>>
"user923005" <dc*****@connx.comwrote in message
news:11**********************@n60g2000hse.googl egroups.com...
A function should have a correct prototype in scope when it is
called. Quite often, that bit will allow the compiler to do whatever
conversions are required.
I can't really parse your sentences above very well.
unsigned long KISS(void);
static unsigned long t, x=123456789, y=362436069, z=21288629,
w=14921776, c=0;

#include <stdio.h>
int main(void){
unsigned long g, i;
for (i=1;i<=100000;++i)
{
g=KISS();
if(i 99996){
printf("%lu %lu\n",i, g);
}
}
// system("pause");
return 0;
}

unsigned long KISS(){
x+=545925293;
y^=(y<<13); y^=(y>>17); y^=(y<<5);
t=z+w+c; z=w; c=(t>>31); w=t&2147483647;
return(x+y+w);
}
This seems to work. I think my variables were at the wrong scope. Thanks
for your help.

All the static unsigned longs can (should) be placed in KISS.
...else why the static modifier?
All objects defined at file scope have static duration, with or
without the qualifier. The static modifier there restricts them to
internal linkage (they are not visible outside this translation unit).

The static qualifier for an object with block scope is the only(?) way
to give the object static duration. It doesn't affect visibility or
linkage at all.
Remove del for email
Jun 30 '07 #16

"Barry Schwarz" <sc******@doezl.netwrote in message
news:tl********************************@4ax.com...
On Fri, 29 Jun 2007 19:49:57 -0400, "Wade Ward" <in*****@invalid.nyet>
wrote:
>>
"Barry Schwarz" <sc******@doezl.netwrote in message
news:ku********************************@4ax.com. ..
>>All the static unsigned longs can (should) be placed in KISS.
...else why the static modifier?

All objects defined at file scope have static duration, with or
without the qualifier. The static modifier there restricts them to
internal linkage (they are not visible outside this translation unit).

The static qualifier for an object with block scope is the only(?) way
to give the object static duration. It doesn't affect visibility or
linkage at all.
Thanks again for your help. I was pretty impressed that I got the printf
correct, but I would never have gotten the finer points.
--
WW
Jun 30 '07 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tonguç Yumruk | last post by:
Is there a way to identify the caller of a function? For example: def foo(): print <Caller Functions name> def bar(): foo() I want foo to print "bar"... And it will be great if I can also...
1
by: Yasutaka Ito | last post by:
Hi, Is there a way to programmatically find out the caller of your function? For example, let's say I have a function called MyFunction(), and I want to debug print the caller of this function...
20
by: 2pac | last post by:
in this scenario foo1 ---calls---> foo2 is it possible for me to print out - when the control is within foo2 - the caller of foo2 the information is obviously there in the stack - am wondering...
4
by: ykz | last post by:
what format shall i use to print clock_t variables? i tried %f, %i, %S or %M(seconds or minutes, as said in K&R2 book), all seem not to work. the code is like: #include <time.h> clock_t t1,...
8
by: M. Moennigmann | last post by:
Dear all: I would like to write a function that opens a file, reads and stores data into an 2d array, and passes that array back to the caller (=main). The size of the array is not known before...
8
by: Tony | last post by:
Hello I am learning C# and encountered the following problem when I tried to figure out how to print the string {0} in a Console window The following piece of codes complied OK. But when I...
3
by: QQ | last post by:
Hello, Here is my simple program int main() { unsigned char a =0x81; char b = 0x81; printf("unsigned char = 0x%x(%d), char = 0x%x(%d)\n",a,a,b,b); printf("cast char to unsigned...
11
by: hg | last post by:
Hi, Considering the float 0.0, I would like to print 00.00. I tried '%02.02f' % 0.0 ... but I get 0.00 Any clue ? Thanks,
3
by: Francesco Guerrieri | last post by:
Hi, Today I've been thinking a bit about the "python internals". Inspired by this recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66062 I found out a little problem which...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.