|
Hi,
When memory is allocated in a function, isn't it impossible to use that memory outside the function by returning its address?
Are there exceptions? It seems the following is such an "example":
const char * f() { return "HELLO"; }
How to explain it...
Started by Tim on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Examples of these things are blocks of memory.
String literals are allocated statically, so returning the address of a string of the function call; it's okay to return addresses to them.
Is another story...
|
|
I'm using getaddrinfo() to return all assigned IP addresses (both IPv4 and IPv6) for my local machine. I see that on XP, getaddrinfo() only returns ::1
( I installed the IPV6 stack on 2 XP machine and configured the IPV6 address and pinged the both peers...
Started by Sachin on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Well, in the ::1 address (or, rather, in any address, that has a double colon in it) double colon expands into the number of zero-bits, neccessary to pad the address to full length this is the only....
The returned list .
|
|
I know that if I am inside some fuction foo() which is called somewhere from bar() function, then this return address is pushed on stack.
#include <stdio.h> void foo() { unsigned int x; printf("inside foo %x \n", &x ); } int main() { foo(); printf...
Started by vinit dhatrak on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
Remember between the first....
There is a gcc builtin for this: void * __builtin_return_address (unsigned (in opposite order) and then a call is made that will push the return address.
There is your return address.
|
Ask your Facebook Friends
|
See the following code:
accept(sockfd, (struct sockaddr*)&cliaddr, &slen); cout << inet_ntop(AF_INET, cliaddr.sin_addr, ipv4addr, 100);
my client connects from localhost. i get an absurd address in the output. this is not my ip address. everytime...
Started by iamrohitbanga on
, 5 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
My next guess:
On success, inet.
Believe to be the client address, then your conversion is incorrect.
|
|
I know, it's a bit weird asking for a query to tell me my own email address right, I'll explain further...
I'm writing a COM add-in for Outlook 2007. One of the subs generates and sends an email to a particular address and this all works fine. However...
Started by 9cents on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
SMTP_ADDRESS or it DASL "http://schemas.microsoft.com/mapi/proptag/0x39FE001E"
Though reading you.
|
|
We need to log the client's IP address from a Seam action. Currently, we're using the code:
ExternalContext context = FacesContext.getCurrentInstance().getExternalContext(); HttpServletRequest request = (HttpServletRequest)context.getRequest(); this.remoteAddress...
Started by Greg Charles on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Additionally, you may want to modify your log ....
You can 'see through' a proxy and get the address of the original requestor from the X_FORWARDED of X_FORWARDED__FOR
What you need is for your reverse proxy to pass the original IP address.
|
|
In my application, I have to send notification e-mails from time to time. In order to send mail (over SMTP), I have to get the MX server of that particular domain (domain part of e-mail address). This is not a Unix application but an Embedded one.
What...
Started by Malkocoglu on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
If the system (or ISP) resolver ....
There really is no need to go past step 2 .
I completely take out the MX entry for my unused / parked domains, it saves my mail server a lot of grief (SPAM) .
It could be that the domain simply does not have a MX record .
|
|
Hi there,
I am having a problem with the AddressBook framework. It all seems to be stemming from ABCopyRecordForUniqueId returning a record with old data.
Example:
I run up the program below in one terminal window - it shows the current data.
I make a...
Started by Marcus Wood on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
As far as I can tell:
The address book....
For the shared address book inside the loop (in case there was some weirdness going on with the address Reference) as well as the higher-level address book framework reference and guide.
|
|
I'm using Qt Creator 4.5 with GCC 4.3 and I'm having the following problem that I am not sure is Qt or C++ related: I call a function with a char * as an input parameter. Inside that function I make a dynamic allocation and I assign the address to the...
Started by yan bellavance on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Your msgByte=new char[theSize]....
Parameters in the call putDatagrams(a, b, c) are sent by value - you wouldn't expect assigning to index in the code to change the value of b at the call site .
Everything in C++ is, by default, passed by value.
Well, yes.
|
|
I'm using cxf and jetty behind apache to expose a webservice via soap. The goal is to start jetty on http://localhost:9000 in all cases and have apache proxy to it, but have the autogenerated wsdl show a soap:address appropriate to the environment it'...
Started by evil_breeds on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Endpoint configuration thing has a "publishedEndpointURL" which is used instead of the address.
|