473,386 Members | 1,832 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,386 software developers and data experts.

Is My Program OK?

Greetings!

I am learning C and I came up with this program to test my knowledge.

#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char s[128];
void *p;
sprintf(s, "%p", malloc(0x10));
puts(s);
sscanf(s, "%p", &p);
printf("%p\n", p);
free(p);
return 0;
}

Is it OK? Even if malloc returns NULL?

One thing I am not sure of is what the size of s should be. Is 128
enough? Or too much? How should I know how big to make it?

Thanks in advance -- Andy!
Feb 23 '08 #1
22 1482
On Feb 23, 10:26 am, "Andy G." <andyg...@spamcop.netwrote:
Greetings!

I am learning C and I came up with this program to test my knowledge.

#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char s[128];
void *p;
sprintf(s, "%p", malloc(0x10));
puts(s);
sscanf(s, "%p", &p);
printf("%p\n", p);
free(p);
return 0;

}

Is it OK? Even if malloc returns NULL?
Yes, except the sprintf() part.
One thing I am not sure of is what the size of s should be. Is 128
enough? Or too much? How should I know how big to make it?
You cannot know whether it will fit or not.
You should instead use snprintf() and check the return value.
Also, save the pointer somewhere, in case it does not fit in the
buffer so you can free it.

Feb 23 '08 #2
You cannot know whether it will fit or not.
Are you sure? This should do the trick:

int mod = -1;
int len = ((mod = sizeof(void*) % sizeof(char)) == 0) ? sizeof(void*)/
sizeof(char) : sizeof(void*)/sizeof(char)+1;
char s[len];
Feb 23 '08 #3

"Vitillo Roberto" <r.*******@gmail.comwrote in message
news:1a**********************************@p73g2000 hsd.googlegroups.com...
>You cannot know whether it will fit or not.
Are you sure? This should do the trick:

int mod = -1;
int len = ((mod = sizeof(void*) % sizeof(char)) == 0) ? sizeof(void*)/
sizeof(char) : sizeof(void*)/sizeof(char)+1;
char s[len];
I think if my life depended on getting len absolutely right, I would rather
take my chances with len=128.

Especially as your code seems to give len=4 :-)

--
Bart
Feb 23 '08 #4
Ups...
int mod = -1;
int len = ((mod = sizeof(void*)*2 % sizeof(char)) == 0) ?
sizeof(void*)*2/sizeof(char) : sizeof(void*)*2/sizeof(char)+1;
char s[len+1];

Better now? ;)
Feb 23 '08 #5
vi******@gmail.com wrote:
On Feb 23, 10:26 am, "Andy G." <andyg...@spamcop.netwrote:
>Greetings!

I am learning C and I came up with this program to test my knowledge.

#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char s[128];
void *p;
sprintf(s, "%p", malloc(0x10));
puts(s);
sscanf(s, "%p", &p);
printf("%p\n", p);
free(p);
return 0;

}

Is it OK? Even if malloc returns NULL?
Yes, except the sprintf() part.
>One thing I am not sure of is what the size of s should be. Is 128
enough? Or too much? How should I know how big to make it?
You cannot know whether it will fit or not.
You should instead use snprintf() and check the return value.
Also, save the pointer somewhere, in case it does not fit in the
buffer so you can free it.
One more minor point is to cast the argument to printf to a void *,
since the %p specifier is defined as accepting a void pointer value
only.

Maybe also change 's' to unsigned char[].

Feb 23 '08 #6
On Feb 23, 2:33 pm, santosh <santosh....@gmail.comwrote:
vipps...@gmail.com wrote:
On Feb 23, 10:26 am, "Andy G." <andyg...@spamcop.netwrote:
Greetings!
I am learning C and I came up with this program to test my knowledge.
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char s[128];
void *p;
sprintf(s, "%p", malloc(0x10));
puts(s);
sscanf(s, "%p", &p);
printf("%p\n", p);
free(p);
return 0;
}
Is it OK? Even if malloc returns NULL?
Yes, except the sprintf() part.
One thing I am not sure of is what the size of s should be. Is 128
enough? Or too much? How should I know how big to make it?
You cannot know whether it will fit or not.
You should instead use snprintf() and check the return value.
Also, save the pointer somewhere, in case it does not fit in the
buffer so you can free it.

One more minor point is to cast the argument to printf to a void *,
since the %p specifier is defined as accepting a void pointer value
only.
That is not needed in the source mr Andy G. posted.
Feb 23 '08 #7
Vitillo Roberto <r.*******@gmail.comwrites:
>You cannot know whether it will fit or not.
Are you sure? This should do the trick:

int mod = -1;
int len = ((mod = sizeof(void*) % sizeof(char)) == 0) ? sizeof(void*)/
sizeof(char) : sizeof(void*)/sizeof(char)+1;
char s[len];
Nothing about sizeof(void *) can tell you the required output size.
It could tell you something about the possible number of different
pointer values, but that is not the same thing. %p might produce:

<segment: 0x2345 offset: 2998788765 in cluster main:24>

who knows?

--
Ben.
Feb 23 '08 #8
vi******@gmail.com wrote:
On Feb 23, 2:33 pm, santosh <santosh....@gmail.comwrote:
>vipps...@gmail.com wrote:
On Feb 23, 10:26 am, "Andy G." <andyg...@spamcop.netwrote:
Greetings!
>I am learning C and I came up with this program to test my
knowledge.
>#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char s[128];
void *p;
sprintf(s, "%p", malloc(0x10));
puts(s);
sscanf(s, "%p", &p);
printf("%p\n", p);
free(p);
return 0;
>}
>Is it OK? Even if malloc returns NULL?
Yes, except the sprintf() part.
One thing I am not sure of is what the size of s should be. Is 128
enough? Or too much? How should I know how big to make it?
You cannot know whether it will fit or not.
You should instead use snprintf() and check the return value.
Also, save the pointer somewhere, in case it does not fit in the
buffer so you can free it.

One more minor point is to cast the argument to printf to a void *,
since the %p specifier is defined as accepting a void pointer value
only.
That is not needed in the source mr Andy G. posted.
Ah yes. My bad.

Feb 23 '08 #9
"Andy G." <andyg...@spamcop.netwrote:
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
* char s[128];
* void *p;
* sprintf(s, "%p", malloc(0x10));
* puts(s);
* sscanf(s, "%p", &p);
* printf("%p\n", p);
* free(p);
* return 0;

}

Is it OK? Even if malloc returns NULL?

One thing I am not sure of is what the size of s should
be. Is 128 enough? Or too much? How should I know how
big to make it?
No, yes and this big respectively. :-)

Other advice notwithstanding, if you actually want to
print a pointer, even with the possibility of scanning
it back later, then you should print and scan the
representation as an array of unsigned char. The size
(of hex output say) can be computed at compile time.

--
Peter
Feb 26 '08 #10
CBFalconer wrote:
>
Kenneth Brody wrote:
vi******@gmail.com wrote:
[... size needed for "%p" output ...]
You *cannot* know the size.
<pedant>
Well, you can "know" it at runtime, with snprintf():

7.19.6.5p3

The snprintf function returns the number of characters that
would have been written had n been sufficiently large, not
counting the terminating null character, or a negative value
if an encoding error occurred.
</pedant>

The C standard for fprintf says:
[... returns length or negative for error ...]
and for printf says:
[... returns length or negative for error ...]
which seem to provide an adequate means of determining the size
written. Similarly for sprintf. Amazingly enough, these also
allow detecting i/o errors in the output stream.
But, how big should you make the buffer for sprintf(), as the OP
was using?

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h|
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:Th*************@gmail.com>

Feb 26 '08 #11
CBFalconer wrote:
) The C standard for fprintf says:
<snip(returns the number printed, or negative)
) and for printf says:
<snip>
) which seem to provide an adequate means of determining the size
) written. Similarly for sprintf.

Indeed, you can check that sprintf has gone beyond the bounds of your
buffer. _After_ it has clobbered whatever happened to be located behind
it (or invoked some other form of UB). Oopsie.
SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
Feb 26 '08 #12
On 26 Feb 2008 at 20:19, Kenneth Brody wrote:
CBFalconer wrote:
>>
Kenneth Brody wrote:
vi******@gmail.com wrote:
[... size needed for "%p" output ...]
>You *cannot* know the size.

<pedant>
Well, you can "know" it at runtime, with snprintf():

7.19.6.5p3

The snprintf function returns the number of characters that
would have been written had n been sufficiently large, not
counting the terminating null character, or a negative value
if an encoding error occurred.
</pedant>

The C standard for fprintf says:
[... returns length or negative for error ...]
>and for printf says:
[... returns length or negative for error ...]
>which seem to provide an adequate means of determining the size
written. Similarly for sprintf. Amazingly enough, these also
allow detecting i/o errors in the output stream.

But, how big should you make the buffer for sprintf(), as the OP
was using?
You can fprintf it to /dev/null (or NUL), collect the return value, and
then make the buffer that big for sprinf() with the same format string
and arguments.

Of course, that can't be what CBF had in mind as it's off-topic, not
portable, not C, can't discuss it, blah blah.

Feb 26 '08 #13
On Tue, 26 Feb 2008 15:19:33 -0500, Kenneth Brody
<ke******@spamcop.netwrote:
>CBFalconer wrote:
>>
Kenneth Brody wrote:
vi******@gmail.com wrote:
[... size needed for "%p" output ...]
>You *cannot* know the size.

<pedant>
Well, you can "know" it at runtime, with snprintf():

7.19.6.5p3

The snprintf function returns the number of characters that
would have been written had n been sufficiently large, not
counting the terminating null character, or a negative value
if an encoding error occurred.
</pedant>

The C standard for fprintf says:
[... returns length or negative for error ...]
>and for printf says:
[... returns length or negative for error ...]
>which seem to provide an adequate means of determining the size
written. Similarly for sprintf. Amazingly enough, these also
allow detecting i/o errors in the output stream.

But, how big should you make the buffer for sprintf(), as the OP
was using?
The C Standard says this about the "%p" conversion specification:

"The argument shall be a pointer to void. The value of the pointer is
converted to a sequence of printing characters, in an
implementation-defined manner."

This means that this program:

#include <stdio.h>
int main(void)
{
printf("%p\n", (void*)0);
return 0;
}

can produce the following output in a strictly conforming
implementation:

The quick brown fox jumps over the lazy dog.

It could also output the text of The Declaration of Independence or of
the book War and Peace. In other words, strictly speaking, the answer
to the OP's question is: we don't know and we can't say.

Practically speaking, though, a buffer size that is a generous power
of 2 will work. I'd be comfortable with s[16], but personally I'd use
a very cheap s[32] just for good measure.

In my experience, sprintf'ing a pointer value to a string (in, for
example, a debug log message), requires that you use a size for the
string that is sufficient in size by eyeballing it. For example:

char s[128];
sprintf("p is %p\n", (void*)p);

Although the size 128 is, strictly speaking, not guaranteed to be
sufficient in size to accomodate the "%p" conversion specification
along with the accompanying text, it is sufficient for practical
purposes, all things considered.

--
jay
Feb 27 '08 #14
jaysome wrote:
On Tue, 26 Feb 2008 15:19:33 -0500, Kenneth Brody
<ke******@spamcop.netwrote:
>>CBFalconer wrote:
>>>
Kenneth Brody wrote:
vi******@gmail.com wrote:
[... size needed for "%p" output ...]
>>You *cannot* know the size.

<pedant>
Well, you can "know" it at runtime, with snprintf():

7.19.6.5p3

The snprintf function returns the number of characters that
would have been written had n been sufficiently large, not
counting the terminating null character, or a negative value
if an encoding error occurred.
</pedant>

The C standard for fprintf says:
[... returns length or negative for error ...]
>>and for printf says:
[... returns length or negative for error ...]
>>which seem to provide an adequate means of determining the size
written. Similarly for sprintf. Amazingly enough, these also
allow detecting i/o errors in the output stream.

But, how big should you make the buffer for sprintf(), as the OP
was using?

The C Standard says this about the "%p" conversion specification:

"The argument shall be a pointer to void. The value of the pointer is
converted to a sequence of printing characters, in an
implementation-defined manner."

This means that this program:

#include <stdio.h>
int main(void)
{
printf("%p\n", (void*)0);
return 0;
}

can produce the following output in a strictly conforming
implementation:

The quick brown fox jumps over the lazy dog.

It could also output the text of The Declaration of Independence or of
the book War and Peace. In other words, strictly speaking, the answer
to the OP's question is: we don't know and we can't say.

Practically speaking, though, a buffer size that is a generous power
of 2 will work. I'd be comfortable with s[16], but personally I'd use
a very cheap s[32] just for good measure.

In my experience, sprintf'ing a pointer value to a string (in, for
example, a debug log message), requires that you use a size for the
string that is sufficient in size by eyeballing it. For example:

char s[128];
sprintf("p is %p\n", (void*)p);

Although the size 128 is, strictly speaking, not guaranteed to be
sufficient in size to accomodate the "%p" conversion specification
along with the accompanying text, it is sufficient for practical
purposes, all things considered.
I suppose the proper way to do this is:

char *ptr = "hello";
char *a;
int n = snprintf(NULL, 0, "%p", ptr);
if (n 0) {
a = malloc(n + 1);
if (!a) exit(EXIT_FAILURE);
else {
int m;
m = snprintf(a, n + 1, "%p", ptr);
if (m < 0 || m < n) {
/* error */
}
}
}
else /* error */

Feb 27 '08 #15
On Feb 27, 1:59 pm, santosh <santosh....@gmail.comwrote:
jaysome wrote:
On Tue, 26 Feb 2008 15:19:33 -0500, Kenneth Brody
<kenbr...@spamcop.netwrote:
>CBFalconer wrote:
>Kenneth Brody wrote:
vipps...@gmail.com wrote:
[... size needed for "%p" output ...]
You *cannot* know the size.
<pedant>
Well, you can "know" it at runtime, with snprintf():
7.19.6.5p3
The snprintf function returns the number of characters that
would have been written had n been sufficiently large, not
counting the terminating null character, or a negative value
if an encoding error occurred.
</pedant>
>The C standard for fprintf says:
[... returns length or negative for error ...]
and for printf says:
[... returns length or negative for error ...]
which seem to provide an adequate means of determining the size
written. Similarly for sprintf. Amazingly enough, these also
allow detecting i/o errors in the output stream.
>But, how big should you make the buffer for sprintf(), as the OP
was using?
The C Standard says this about the "%p" conversion specification:
"The argument shall be a pointer to void. The value of the pointer is
converted to a sequence of printing characters, in an
implementation-defined manner."
This means that this program:
#include <stdio.h>
int main(void)
{
printf("%p\n", (void*)0);
return 0;
}
can produce the following output in a strictly conforming
implementation:
The quick brown fox jumps over the lazy dog.
It could also output the text of The Declaration of Independence or of
the book War and Peace. In other words, strictly speaking, the answer
to the OP's question is: we don't know and we can't say.
Practically speaking, though, a buffer size that is a generous power
of 2 will work. I'd be comfortable with s[16], but personally I'd use
a very cheap s[32] just for good measure.
In my experience, sprintf'ing a pointer value to a string (in, for
example, a debug log message), requires that you use a size for the
string that is sufficient in size by eyeballing it. For example:
char s[128];
sprintf("p is %p\n", (void*)p);
Although the size 128 is, strictly speaking, not guaranteed to be
sufficient in size to accomodate the "%p" conversion specification
along with the accompanying text, it is sufficient for practical
purposes, all things considered.

I suppose the proper way to do this is:

char *ptr = "hello";
Shouldnt this be const char* ptr="hello";
char *a;
int n = snprintf(NULL, 0, "%p", ptr);
if (n 0) {
a = malloc(n + 1);
if (!a) exit(EXIT_FAILURE);
else {
int m;
m = snprintf(a, n + 1, "%p", ptr);
if (m < 0 || m < n) {
/* error */
}
}}

else /* error */
Feb 27 '08 #16
santosh said:
jaysome wrote:
<snip>
>Although the size 128 is, strictly speaking, not guaranteed to be
sufficient in size to accomodate the "%p" conversion specification
along with the accompanying text, it is sufficient for practical
purposes, all things considered.

I suppose the proper way to do this is:

char *ptr = "hello";
char *a;
int n = snprintf(NULL, 0, "%p", ptr);
It can, of course, be done without snprintf, for those who must avoid that
function for portability reasons - albeit not terribly elegantly. The
obvious way is to use a temporary file and fprintf:

int n = 0;
FILE *fp = tmpfile();
if(tmpfile != NULL)
{
n = fprintf(fp, "%p", (void *)ptr);
fclose(fp);
}
if(n 0)
{
n + 1 tells us how many bytes to malloc for the string.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Feb 27 '08 #17
jaysome wrote:
>
On Tue, 26 Feb 2008 15:19:33 -0500, Kenneth Brody
<ke******@spamcop.netwrote:
CBFalconer wrote:
>
Kenneth Brody wrote:
vi******@gmail.com wrote:
[... size needed for "%p" output ...]
You *cannot* know the size.

<pedant>
Well, you can "know" it at runtime, with snprintf():

7.19.6.5p3

The snprintf function returns the number of characters that
would have been written had n been sufficiently large, not
counting the terminating null character, or a negative value
if an encoding error occurred.
</pedant>

The C standard for fprintf says:
[... returns length or negative for error ...]
and for printf says:
[... returns length or negative for error ...]
which seem to provide an adequate means of determining the size
written. Similarly for sprintf. Amazingly enough, these also
allow detecting i/o errors in the output stream.
But, how big should you make the buffer for sprintf(), as the OP
was using?

The C Standard says this about the "%p" conversion specification:

"The argument shall be a pointer to void. The value of the pointer is
converted to a sequence of printing characters, in an
implementation-defined manner."

This means that this program:

#include <stdio.h>
int main(void)
{
printf("%p\n", (void*)0);
return 0;
}

can produce the following output in a strictly conforming
implementation:

The quick brown fox jumps over the lazy dog.
[...]
Although the size 128 is, strictly speaking, not guaranteed to be
sufficient in size to accomodate the "%p" conversion specification
along with the accompanying text, it is sufficient for practical
purposes, all things considered.
Or, you could do as I pointed out -- use snprintf() to tell you how
long the output will be. (Something which can't be done with CBF's
suggestion of fprintf/printf/sprintf, since those will only tell you
after the fact, not before.)

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h|
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:Th*************@gmail.com>
Feb 27 '08 #18
Willem wrote:
CBFalconer wrote:
>The C standard for fprintf says:
<snip(returns the number printed, or negative)
>and for printf says:
<snip>
>which seem to provide an adequate means of determining the size
written. Similarly for sprintf.

Indeed, you can check that sprintf has gone beyond the bounds of
your buffer. _After_ it has clobbered whatever happened to be
located behind it (or invoked some other form of UB). Oopsie.
You can know in advance the max length of most fields to be
written. For strings, you can apply strlen. If you have room to
absorb the max, you can always measure what was actually emitted.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.

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

Feb 27 '08 #19
CBFalconer wrote:
Willem wrote:
>CBFalconer wrote:
>>The C standard for fprintf says:
<snip(returns the number printed, or negative)
>>and for printf says:
<snip>
>>which seem to provide an adequate means of determining the size
written. Similarly for sprintf.

Indeed, you can check that sprintf has gone beyond the bounds of
your buffer. _After_ it has clobbered whatever happened to be
located behind it (or invoked some other form of UB). Oopsie.

You can know in advance the max length of most fields to be
written. For strings, you can apply strlen. If you have room to
absorb the max, you can always measure what was actually emitted.
Yes, but the case in question involves finding out how many characters
would be emitted for a pointer value printed out with the %p specifier,
which the Standard doesn't say anything about.

The easiest way to do this without any I/O at all is with snprintf.
Otherwise Richard's solution involving a temporary file and fprintf is
neat as well, since a file cannot (practically) cause a buffer
overflow. It *could* fill up the disk, but it will be immediately
deleted after storing and checking fprintf's return value.

The other option is to print the pointer value as an array of unsigned
char.

Feb 27 '08 #20
On Feb 27, 8:59 am, santosh <santosh....@gmail.comwrote:
jaysome wrote:
The C Standard says this about the "%p" conversion specification:
"The argument shall be a pointer to void. The value of the pointer is
converted to a sequence of printing characters, in an
implementation-defined manner."

Is there a guarantee that two calls to printf will produce
the same output? IOW, if we follow santosh's suggestion of:
char *ptr = "hello";
char *a;
int n = snprintf(NULL, 0, "%p", ptr);
if (n 0) {
a = malloc(n + 1);
if (!a) exit(EXIT_FAILURE);
else {
int m;
m = snprintf(a, n + 1, "%p", ptr);
if (m < 0 || m < n) {
/* error */
}
}}
Is there any guarantee that n + 1 is enough?
Perhaps the first snprintf returns enough space
to write "the quick brown fox", but the
second attempts to print the Declaration of
Independence.
Feb 27 '08 #21

"William Pursell" <bi**********@gmail.comwrote in message
news:85**********************************@i29g2000 prf.googlegroups.com...
On Feb 27, 8:59 am, santosh <santosh....@gmail.comwrote:
>jaysome wrote:
The C Standard says this about the "%p" conversion specification:
"The argument shall be a pointer to void. The value of the pointer is
converted to a sequence of printing characters, in an
implementation-defined manner."


Is there a guarantee that two calls to printf will produce
the same output? IOW, if we follow santosh's suggestion of:
....
>
Is there any guarantee that n + 1 is enough?
Perhaps the first snprintf returns enough space
to write "the quick brown fox", but the
second attempts to print the Declaration of
Independence.
They have to be the same. If not then it makes printing %p more or less
impossible in a reliable way.

Unless you print to a file first, but that starts becoming a crazy way to do
this.

The standard should have specified an upper limit for %p format length.

--
Bart
Feb 28 '08 #22
Bartc wrote:
"William Pursell" <bi**********@gmail.comwrote in message
news:85**********************************@i29g2000 prf.googlegroups.com...
>On Feb 27, 8:59 am, santosh <santosh....@gmail.comwrote:
>>jaysome wrote:
The C Standard says this about the "%p" conversion specification:
"The argument shall be a pointer to void. The value of the pointer is
converted to a sequence of printing characters, in an
implementation-defined manner."

Is there a guarantee that two calls to printf will produce
the same output? IOW, if we follow santosh's suggestion of:
...
>Is there any guarantee that n + 1 is enough?
Perhaps the first snprintf returns enough space
to write "the quick brown fox", but the
second attempts to print the Declaration of
Independence.

They have to be the same. If not then it makes printing %p more or less
impossible in a reliable way.
This, however, is a QoI issue, and not a mandate from the standard. A
nasty-but-conforming implementation could print %p differently for the
samve value on a second call.

--
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
Feb 28 '08 #23

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

Similar topics

2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
22
by: edgrsprj | last post by:
PROPOSED EARTHQUAKE FORECASTING COMPUTER PROGRAM DEVELOPMENT EFFORT Posted July 11, 2005 My main earthquake forecasting Web page is: http://www.freewebz.com/eq-forecasting/Data.html ...
0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
11
by: christopher diggins | last post by:
I am wondering if any can point me to any open-source library with program objects for C++ like there is in Java? I would like to be able to write things like MyProgram1 >> MyProgram2 >>...
1
by: Eric Whittaker | last post by:
hi all, im trying to write my first c++ program. a success, but i can't get the window to stay open after user enters input. it just automatically closes. right now the end of my program looks...
9
by: Hemal | last post by:
Hi All, I need to know the memory required by a c program. Is there any tool/utility which can give me the memory usage in terms of DATA segment, TEXT segment, BSS segment etc. I am working...
7
by: ibtc209 | last post by:
I just started programming in C, and I need some help with this problem. Your program will read the information about one MiniPoker hand, namely the rank and suit of the hand’s first card, and...
2
Banfa
by: Banfa | last post by:
Posted by Banfa The previous tutorial discussed what programming is, what we are trying to achieve, the answer being a list of instructions constituting a valid program. Now we will discuss how...
0
amitpatel66
by: amitpatel66 | last post by:
There is always a requirement that in Oracle Applications, the Concurrent Program need to be execute programatically based on certain conditions/validations: Concurrent programs can be executed...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...

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.