473,412 Members | 2,281 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,412 software developers and data experts.

function conversion

Hi,

I know there are in stdlib.h many functions to perform conversion from
string to int, double ecc.
but I don't understand if there are some standards function to perform
conversion from
int, double ecc to string

Thanks.

Jul 2 '07 #1
19 1519
xdevel wrote:
Hi,

I know there are in stdlib.h many functions to perform conversion from
string to int, double ecc.
but I don't understand if there are some standards function to perform
conversion from
int, double ecc to string
I would use sprintf (or snprintf) from stdio.h
>
Thanks.

--
Pietro Cerutti

PGP Public Key:
http://gahr.ch/pgp
Jul 2 '07 #2
On 2 Lug, 15:23, Pietro Cerutti <g...@gahr.chwrote:
xdevel wrote:
Hi,
I know there are in stdlib.h many functions to perform conversion from
string to int, double ecc.
but I don't understand if there are some standards function to perform
conversion from
int, double ecc to string

I would use sprintf (or snprintf) from stdio.h
Thanks.

--
Pietro Cerutti

PGP Public Key:http://gahr.ch/pgp
Yes, but I wish to know if there are standard "one-to-one" functions.
I read that i.e. itoa is not!

Jul 2 '07 #3

"xdevel" <xd********@gmail.comwrote in message
news:11*********************@g4g2000hsf.googlegrou ps.com...
Hi,

I know there are in stdlib.h many functions to perform conversion from
string to int, double ecc.
but I don't understand if there are some standards function to perform
conversion from
int, double ecc to string
'sprintf()' works like 'printf()', except the output
is to a string instead of stdout.

(Be careful to ensure that your strings are large
enough to hold the output).

-Mike
Jul 2 '07 #4
Mike Wahler wrote:
"xdevel" <xd********@gmail.comwrote in message
news:11*********************@g4g2000hsf.googlegrou ps.com...
>Hi,

I know there are in stdlib.h many functions to perform conversion from
string to int, double ecc.
but I don't understand if there are some standards function to perform
conversion from
int, double ecc to string

'sprintf()' works like 'printf()', except the output
is to a string instead of stdout.

(Be careful to ensure that your strings are large
enough to hold the output).
Or use snprintf() and set the limit yourself.
>
-Mike


--
Pietro Cerutti

PGP Public Key:
http://gahr.ch/pgp
Jul 2 '07 #5
xdevel <xd********@gmail.comwrites:
On 2 Lug, 15:23, Pietro Cerutti <g...@gahr.chwrote:
>xdevel wrote:
I know there are in stdlib.h many functions to perform conversion from
string to int, double ecc.
but I don't understand if there are some standards function to perform
conversion from
int, double ecc to string

I would use sprintf (or snprintf) from stdio.h

Yes, but I wish to know if there are standard "one-to-one" functions.
I read that i.e. itoa is not!
No.

You can see all the functions in the standard C library by reading the
standard; search for "n1124.pdf" to see the latest draft.

(Please don't quote signatures; trim quoted material to what's
necessary for your response to make sense.)

--
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"
Jul 2 '07 #6
Pietro Cerutti <ga**@gahr.chwrites:
Mike Wahler wrote:
>"xdevel" <xd********@gmail.comwrote in message
news:11*********************@g4g2000hsf.googlegro ups.com...
>>I know there are in stdlib.h many functions to perform conversion from
string to int, double ecc.
but I don't understand if there are some standards function to perform
conversion from
int, double ecc to string

'sprintf()' works like 'printf()', except the output
is to a string instead of stdout.

(Be careful to ensure that your strings are large
enough to hold the output).

Or use snprintf() and set the limit yourself.
If your implementation provides snprintf(). That function was added
in C99; many non-C99 implementations provide it as an extension, but
not all do.

--
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"
Jul 2 '07 #7
Keith Thompson wrote:
Pietro Cerutti <ga**@gahr.chwrites:
>Mike Wahler wrote:
>>"xdevel" <xd********@gmail.comwrote in message
news:11*********************@g4g2000hsf.googlegr oups.com...
I know there are in stdlib.h many functions to perform conversion from
string to int, double ecc.
but I don't understand if there are some standards function to perform
conversion from
int, double ecc to string
'sprintf()' works like 'printf()', except the output
is to a string instead of stdout.

(Be careful to ensure that your strings are large
enough to hold the output).
Or use snprintf() and set the limit yourself.

If your implementation provides snprintf(). That function was added
in C99; many non-C99 implementations provide it as an extension, but
not all do.
Uh, I wasn't aware of the fact that snprintf (and also vsnprintf) were
added only in C99.

Tnx for pointing it out!
--
Pietro Cerutti

PGP Public Key:
http://gahr.ch/pgp
Jul 2 '07 #8
Pietro Cerutti wrote, On 02/07/07 18:05:
Keith Thompson wrote:
>Pietro Cerutti <ga**@gahr.chwrites:
<snip>
>>Or use snprintf() and set the limit yourself.
If your implementation provides snprintf(). That function was added
in C99; many non-C99 implementations provide it as an extension, but
not all do.

Uh, I wasn't aware of the fact that snprintf (and also vsnprintf) were
added only in C99.
You also need to be aware that not all C89 implementations that provide
it as an extension provide the same semantics as C99 requires. IIRC the
_snprintf function MS provide has different sementaics (this is legal as
it starts with an _ and MS do not claim C99), for example.
--
Flash Gordon
Jul 2 '07 #9
On 2007-07-02, Flash Gordon <sp**@flash-gordon.me.ukwrote:
Pietro Cerutti wrote, On 02/07/07 18:05:
>Keith Thompson wrote:
>>Pietro Cerutti <ga**@gahr.chwrites:

<snip>
>>>Or use snprintf() and set the limit yourself.
If your implementation provides snprintf(). That function was added
in C99; many non-C99 implementations provide it as an extension, but
not all do.

Uh, I wasn't aware of the fact that snprintf (and also vsnprintf) were
added only in C99.

You also need to be aware that not all C89 implementations that provide
it as an extension provide the same semantics as C99 requires. IIRC the
_snprintf function MS provide has different sementaics (this is legal as
it starts with an _ and MS do not claim C99), for example.
At first when I read this I was surprised that this was legal
since I thought that identifiers starting with an underscore
are reserved. Then when I checked the standard I understood that
it is reserved for implementations, which it is in this case.

I just want to check if I've understood this correct:
is it true, that all the reserved identifiers in the standard
are reserved for use only by the implementations?
That is, if I'm writing and implementation of the standard libary
I am permitted to define new functions starting with an underscore,
but _not_ if I'm making some library that is not the standard lib?

--
Michael Brennan

Jul 2 '07 #10
On 2 Lug, 18:43, Keith Thompson <k...@mib.orgwrote:
xdevel <xdevel1...@gmail.comwrites:
On 2 Lug, 15:23, Pietro Cerutti <g...@gahr.chwrote:
xdevel wrote:
I know there are in stdlib.h many functions to perform conversion from
string to int, double ecc.
but I don't understand if there are some standards function to perform
conversion from
int, double ecc to string
I would use sprintf (or snprintf) from stdio.h
Yes, but I wish to know if there are standard "one-to-one" functions.
I read that i.e. itoa is not!

No.

You can see all the functions in the standard C library by reading the
standard; search for "n1124.pdf" to see the latest draft.

(Please don't quote signatures; trim quoted material to what's
necessary for your response to make sense.)

--
Keith Thompson (The_Other_Keith) k...@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"
ok I have seen in the n1124 so my question is simply for which reasons
there aren't!
philosophical? technical? not important thanks to sprintf and other
solutions?
is not better to make all the possible functions to manage almost
every programming aspect?
may be, but obviously this is only a my "poor" opinion if a c (or c++)
programmer had more
standard library functions should be more productive (think to Java,
C# and so on).
But this problem is also a C++ problem (for making some very useful
thinks we have to use a great external library named BOOST).

Regards

Jul 3 '07 #11
In article <3x****************@newsb.telia.net>,
Michael Brennan <br************@gmail.comwrote:
>... I just want to check if I've understood this correct:
is it true, that all the reserved identifiers in the standard
are reserved for use only by the implementations?
That is, if I'm writing and implementation of the standard libary
I am permitted to define new functions starting with an underscore,
but _not_ if I'm making some library that is not the standard lib?
Essentially, yes. (A future standard could, however, use names in
the "implementation name space" as new, standard names, creating
problems for implementors who used those names themselves. In
practice, though, standards groups doing updates actually tend to
take whatever names they like, rather than sticking with just the
implementor space. In other words, the C0x or C1x group is likely
to pester both implementors *and* users, the same way the C99 group
did.)

It may help to think of it this way: as far as the C-Standards-
Writers are concerned, there are only two kinds of people in the
world: "implementors" and "users". So, they gave "implementors"
one set of names to use, that they told the "users" to stay away
from; and they gave "users" the rest of the names, so implementors
must stay away from those.

This world-view quickly breaks down in the presence of "third party
vendors". If you are a third-party vendor, so that you are not
writing a compiler, but are also not the end-user writing the code
to use with the compiler, what names shall *you* use? (Probably
the best approach is to pick some sort of "library prefix" for
yourself, using one that lives in the "user" name space, and tell
your customers: "We will use names starting with <fill in your
prefix>, so if you avoid those, but otherwise stick with user name
space names, you will be OK." This, of course, does not help the
user who wants to use both your library *and* a second third-party
library, if you and the other third-party vendor choose the same
prefix.)
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: forget about it http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.
Jul 3 '07 #12
On 2007-07-03, Chris Torek <no****@torek.netwrote:
In article <3x****************@newsb.telia.net>,
Michael Brennan <br************@gmail.comwrote:
>>... I just want to check if I've understood this correct:
is it true, that all the reserved identifiers in the standard
are reserved for use only by the implementations?
That is, if I'm writing and implementation of the standard libary
I am permitted to define new functions starting with an underscore,
but _not_ if I'm making some library that is not the standard lib?

Essentially, yes. (A future standard could, however, use names in
the "implementation name space" as new, standard names, creating
problems for implementors who used those names themselves. In
practice, though, standards groups doing updates actually tend to
take whatever names they like, rather than sticking with just the
implementor space. In other words, the C0x or C1x group is likely
to pester both implementors *and* users, the same way the C99 group
did.)

It may help to think of it this way: as far as the C-Standards-
Writers are concerned, there are only two kinds of people in the
world: "implementors" and "users". So, they gave "implementors"
one set of names to use, that they told the "users" to stay away
from; and they gave "users" the rest of the names, so implementors
must stay away from those.

This world-view quickly breaks down in the presence of "third party
vendors". If you are a third-party vendor, so that you are not
writing a compiler, but are also not the end-user writing the code
to use with the compiler, what names shall *you* use? (Probably
the best approach is to pick some sort of "library prefix" for
yourself, using one that lives in the "user" name space, and tell
your customers: "We will use names starting with <fill in your
prefix>, so if you avoid those, but otherwise stick with user name
space names, you will be OK." This, of course, does not help the
user who wants to use both your library *and* a second third-party
library, if you and the other third-party vendor choose the same
prefix.)
Thank you for your excellent answer!

--
Michael Brennan

Jul 4 '07 #13
Chris Torek wrote:
>
.... snip ...
>
This world-view quickly breaks down in the presence of "third party
vendors". If you are a third-party vendor, so that you are not
writing a compiler, but are also not the end-user writing the code
to use with the compiler, what names shall *you* use? (Probably
the best approach is to pick some sort of "library prefix" for
yourself, using one that lives in the "user" name space, and tell
your customers: "We will use names starting with <fill in your
prefix>, so if you avoid those, but otherwise stick with user name
space names, you will be OK." This, of course, does not help the
user who wants to use both your library *and* a second third-party
library, if you and the other third-party vendor choose the same
prefix.)
This idea breaks down completely for the forseeable future, because
there are no arbitrary namespaces available in C. The prefix
portion is perfectly usable, but not guaranteed.

--
<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

Jul 5 '07 #14
CBFalconer <cb********@yahoo.comwrote:
Chris Torek wrote:

This world-view quickly breaks down in the presence of "third party
vendors". If you are a third-party vendor, so that you are not
writing a compiler, but are also not the end-user writing the code
to use with the compiler, what names shall *you* use? (Probably
the best approach is to pick some sort of "library prefix" for
yourself, using one that lives in the "user" name space, and tell
your customers: "We will use names starting with <fill in your
prefix>, so if you avoid those, but otherwise stick with user name
space names, you will be OK." This, of course, does not help the
user who wants to use both your library *and* a second third-party
library, if you and the other third-party vendor choose the same
prefix.)

This idea breaks down completely for the forseeable future, because
there are no arbitrary namespaces available in C. The prefix
portion is perfectly usable, but not guaranteed.
It breaks down even when you add namespaces the way they're normally
done, exactly because of Chris' last sentence. I guarantee you that when
you write a program to handle Dynamically Linked Libraries that uses
Doubly Linked Lists, and you want to delete a member from a list, you
will not want to worry whether dll.delete() doesn't remove a function
from your library.
The only way I can think of to solve this, but one which I've never seen
used in actual practice, is to leave the choice of prefix to the user-
programmer, instead of, as is now usually done, to the library
implementor. For example, you could have a new feature in a hypothetical
next Standard for C:

#include <sys/dll.has lib
#include <common/dll.has dlist

int main(void)
{
...
lib.delete(funcname);
...
dlist.delete("tempdata");
...
callfunc(funcname, paramlistptr);
sort(entrylist);
...
return 0;
}

The "as" keyword itself does not invade the user namespace, since it
occurs only in #include statements; thus, an object called "as" remains
as possible as one called "include". One could even "#include <as.has
as", if one wanted to.
The use of the period for namespace selection is equally unambiguous, as
long as we require that the names used for namespaces are ordinary,
file-scope identifiers - which would make them different from any other
object, and specifically, from any struct or union. To avoid confusion,
one would probably want to forbid shadowing of a namespace identifier
by a later block-scope declaration.
Alternatively, we could use a new operator - perhaps stealing C++'s :: -
but this seems undesirable to me, both because this is really not the
same thing at all as normal namespace operation, and we don't want to
pretend that it is, and because re-using an existing operator in a way
which coincides with its current use really quite well seems to me to
fit well with C's spirit of less-is-more.
Note that, in the above example, I've allowed for calls to functions
(and references to identifiers would work similarly) with, and where
possible also without the namespace identifier. delete() is common to
both headers, so it definitely needs the prefix - and I would suggest
that trying to use it without prefix should invoke undefined behaviour -
but callfunc() and sort() are unique, and can therefore be called
without.

This method _would_ mean that the pre-processor now has a real influence
on the semantics of the normal program code, and is no longer a mere
text replacement tool. But that's the only downside to this solution
that I can see. Even this can be ameliorated if we demand that all
references to namespace members be done with the namespace prefix. That
would, again, allow the pre-processor to function as a text replacer,
although in this case a slightly more complex one; but it would disallow
the calls to sort() and callfunc() in my example, and thus require more
typing.
--
<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
Fix yer sig.

Richard
Jul 5 '07 #15
rl*@hoekstra-uitgeverij.nl (Richard Bos) writes:
CBFalconer <cb********@yahoo.comwrote:
>Chris Torek wrote:
>
This world-view quickly breaks down in the presence of "third party
vendors". If you are a third-party vendor, so that you are not
writing a compiler, but are also not the end-user writing the code
to use with the compiler, what names shall *you* use? (Probably
the best approach is to pick some sort of "library prefix" for
yourself, using one that lives in the "user" name space, and tell
your customers: "We will use names starting with <fill in your
prefix>, so if you avoid those, but otherwise stick with user name
space names, you will be OK." This, of course, does not help the
user who wants to use both your library *and* a second third-party
library, if you and the other third-party vendor choose the same
prefix.)

This idea breaks down completely for the forseeable future, because
there are no arbitrary namespaces available in C. The prefix
portion is perfectly usable, but not guaranteed.

It breaks down even when you add namespaces the way they're normally
done, exactly because of Chris' last sentence.
<snip>
The only way I can think of to solve this, but one which I've never seen
used in actual practice,
<OT>At least one language (Haskell) does this and more with
imports</OT>
is to leave the choice of prefix to the user-
programmer, instead of, as is now usually done, to the library
implementor. For example, you could have a new feature in a hypothetical
next Standard for C:

#include <sys/dll.has lib
#include <common/dll.has dlist
As you point out below, this breaks the idea of '#include' being a
textual operation. The same(ish) effect could be achieved by allowing
a wrapper that adds a prefix chosen by the library user:

with dlist {
#include <common/dll.h>
};

making all the file-scope names in dll.h acquire a prefix[1].
(Personally, I'd rather not see . reused -- maybe : is better.) The
pain comes when the linker has to match up the names. There would
have to be some tool chain support for this. Maybe -ldlist:dll to
show which 'delete' is being referenced. If dll.h is qualified with
dlist in one source module and with 'linked_list' in another one would
need to get creative (-ldlist+linked_list:dll anyone?).

[1] I'd include macro names and structure tags, too.

--
Ben.
Jul 5 '07 #16
Ben Bacarisse <be********@bsb.me.ukwrites:
rl*@hoekstra-uitgeverij.nl (Richard Bos) writes:
[...]
>The only way I can think of to solve this, but one which I've never seen
used in actual practice,

<OT>At least one language (Haskell) does this and more with
imports</OT>
>is to leave the choice of prefix to the user-
programmer, instead of, as is now usually done, to the library
implementor. For example, you could have a new feature in a hypothetical
next Standard for C:

#include <sys/dll.has lib
#include <common/dll.has dlist

As you point out below, this breaks the idea of '#include' being a
textual operation. The same(ish) effect could be achieved by allowing
a wrapper that adds a prefix chosen by the library user:

with dlist {
#include <common/dll.h>
};

making all the file-scope names in dll.h acquire a prefix[1].
(Personally, I'd rather not see . reused -- maybe : is better.) The
pain comes when the linker has to match up the names. There would
have to be some tool chain support for this. Maybe -ldlist:dll to
show which 'delete' is being referenced. If dll.h is qualified with
dlist in one source module and with 'linked_list' in another one would
need to get creative (-ldlist+linked_list:dll anyone?).

[1] I'd include macro names and structure tags, too.
I think using ':' would cause problems with the '?:' operator, which I
suspect is why C++ chose '::'.

I think I'd prefer to let headers define an explicit namespace,
leaving '#include' as a purely textual inclusion. A program can then
import and rename the namespace. For example:

/* foo.h */
namespace foo {
void func(void);
...
}

/* main.c */

#include "foo.h"
import foo as foo1;
...
foo1.func();

The point here is to allow two different 'foo' namespaces to be
imported under different names. There are a lot of details to be
worked out, though.

--
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"
Jul 5 '07 #17
Keith Thompson <ks***@mib.orgwrites:
Ben Bacarisse <be********@bsb.me.ukwrites:
>rl*@hoekstra-uitgeverij.nl (Richard Bos) writes:
[...]
>>The only way I can think of to solve this, but one which I've never seen
used in actual practice,

<OT>At least one language (Haskell) does this and more with
imports</OT>
>>is to leave the choice of prefix to the user-
programmer, instead of, as is now usually done, to the library
implementor. For example, you could have a new feature in a hypothetical
next Standard for C:

#include <sys/dll.has lib
#include <common/dll.has dlist

As you point out below, this breaks the idea of '#include' being a
textual operation. The same(ish) effect could be achieved by allowing
a wrapper that adds a prefix chosen by the library user:

with dlist {
#include <common/dll.h>
};
<snip>
>
I think using ':' would cause problems with the '?:' operator, which I
suspect is why C++ chose '::'.
Agreed. ':' would certainly get messy and is probably un-workable.
I think I'd prefer to let headers define an explicit namespace,
leaving '#include' as a purely textual inclusion. A program can then
import and rename the namespace. For example:

/* foo.h */
namespace foo {
void func(void);
...
}
I intended exactly that (that include should remain textual). The
example I gave was simply to show that the syntax can be put round a
#include. I could have just shown a function prototype inside the
'with'.

Presumably in your notation:

namespace foo {
#include "mydefs.h"
}

would qualify everything in "mydefs.h" with 'foo'. You might be
saying something stronger here: that the syntax would only permit
declarations (and only as-yet-unqualified ones at that). I would
suggest that anything can be put in a namespace (although the only
other things of any practical value are typedefs, structure
definitions, inline functions, and #defines).
/* main.c */

#include "foo.h"
import foo as foo1;
one could save on keywords by making 'namespace fool foo' (to mirror
typedef syntax) mean this.
...
foo1.func();

The point here is to allow two different 'foo' namespaces to be
imported under different names. There are a lot of details to be
worked out, though.
Indeed. Is there any sign that something like this is being
considered? I think it would be a very significant step forward for C
without undermining the basic character of the language.

--
Ben.
Jul 5 '07 #18
Keith Thompson said:

<snip>
I'm also tempted to suggest stealing C++'s namespace feature and
adding it to C more or less intact.
I don't think the C++ guys will be too happy about that. Perhaps we
could just sort of borrow it off them until the weekend?

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jul 6 '07 #19
Richard Heathfield <rj*@see.sig.invalidwrites:
Keith Thompson said:
<snip>
>I'm also tempted to suggest stealing C++'s namespace feature and
adding it to C more or less intact.

I don't think the C++ guys will be too happy about that. Perhaps we
could just sort of borrow it off them until the weekend?
I suggest joint custody.

--
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"
Jul 6 '07 #20

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

Similar topics

14
by: Dave | last post by:
Hello all, Can anybody help with the problem below? I'm trying to define a conversion function that converts objects to function pointers and am getting a compile error on the line indicated...
3
by: Ken | last post by:
hello, I would to know if it is possible to call an object in a function within a class. Meaning , In a class, A function X calling onto a function Y, and function Y we want one of the two...
1
by: Bryan Parkoff | last post by:
I know how to write "Pointer to Function" inside struct or class without using static, but I have decided to add static to all functions inside struct or class because I want member functions to be...
89
by: Sweety | last post by:
hi, Is main function address is 657. its show in all compiler. try it & say why? bye,
21
by: Stephen Biggs | last post by:
Given this code: void f(void){} int main(void){return (int)f+5;} Is there anything wrong with this in terms of the standards? Is this legal C code? One compiler I'm working with compiles this...
27
by: Marlene Stebbins | last post by:
I am experimenting with function pointers. Unfortunately, my C book has nothing on function pointers as function parameters. I want to pass a pointer to ff() to f() with the result that f() prints...
57
by: Robert Seacord | last post by:
i am trying to print the address of a function without getting a compiler warning (i am compiling with gcc with alot of flags). if i try this: printf("%p", f); i get: warning: format %p...
32
by: David Mark | last post by:
I've got a collection of functions that accept a function or object (paired with a method name) as a callback. For the longest time I have relied on this test. (typeof cb == 'function') ...
10
by: colin | last post by:
Hi, I profile my code and find its spending a lot of time doing implicit conversions from similar structures. the conversions are mainly things like this class Point { implicit conversion...
4
by: abendstund | last post by:
Hi, I have the following code and trouble with ambiguity due to operator overloading.. The code is also at http://paste.nn-d.de/441 snip>>
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
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,...
0
jinu1996
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...
0
agi2029
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,...
0
isladogs
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...

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.