|
I am invoking an an MFC exe (inside initinstance () if i put cout<< statement , nothing is reflected in dos winndow.Please if you have any suggestions tell me.
|
|
|
|
|
The application that uses cout should be a console based application(uses main not winmain ) otherwise it won't show up.
|
|
|
|
|
memory for reference variable will be allocated or not?
if yes,where does the reference variable get
stored( stack or heap)?
Thanks in advance.
Prashanth.v
-- modified at 3:07 Wednesday 3rd May, 2006
|
|
|
|
|
What do you mean exactly ? Post some code to illustrate your question.
|
|
|
|
|
this question asked me in interview.
i donot have any code.
question is
where does the reference variable get
stored(stack or heap)?
Prashanth.v
|
|
|
|
|
a reference is nothing more than a dereferenced pointer.
when you create a reference variable, you create a variable first (before looking at its type), so the program NEED to store it somewhere in memory to keep its information.
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
Isn't this an implementation detail?
For example
int a = 10;
int &b = a;
The compiler doesn't have to have memory for b, it can get the appropriate memory location from the symbol table. Of course when not possible to implement in this way compilers use a pointer to implement the reference.
|
|
|
|
|
solution please.
whether it gets stored in stack or heap?
|
|
|
|
|
Unfortunately I think you should have clarified in the interview what was meant by reference variable.
Say you had code like
int a = 10;
int &b = a;
In this case it's not stored anywhere. The compiler just knows what you are referring to.
If you had a function that looks like say
DoSomething(int &b);
int a = 10;
DoSomething(a);
Then the compiler has to implement the reference as passing a pointer to 'a' on the parameter list. Say this calling convention passes all arguments to functions on the stack, would this be considered storing in the stack?
|
|
|
|
|
no memory is allocated to a reference variable.
not in stack nor in heap.
|
|
|
|
|
my application needs us to display active users in the network
can anyone help me wiht some ideas or codes
mad john
|
|
|
|
|
hi,
use the NetUserEnum(...) Api you can list all the Users in a Perticular Domain.
Hope this will be usefull to you.
good luck,
uday.
uday kiran
|
|
|
|
|
THANX 4 THE REPLY
BUT WE NEED FOR A PEER TO PEER MODEL
COULD U HELP US ON THAT
|
|
|
|
|
maybe it is some helpful to you
WM_WTSSESSION_CHANGE
|
|
|
|
|
Through visual studio , I made changes to code and execute.. compiles properly but at execution it gives error
debug assertion failed..
File : wincore.cpp
Line : 875
I try 3-4 or some more times then i can run my program properly.
WHy is this happening just after compile and execute.
pathak
|
|
|
|
|
Through visual studio , I made changes to code and execute.. compiles properly but at execution it gives error
debug assertion failed..
File : wincore.cpp
Line : 875
I try 3-4 or some more times then i can run my program properly.
WHy is this happening just after compile and execute.
pathak
|
|
|
|
|
You have done something wrong with the new code you have changed.
Start your debugger (F5) and check the call stack to see in wich of your function the program crashes.
You don't provide enough information for us to help.
|
|
|
|
|
Man,
I tried to debug.. but at the start point only it halts.
AS you know when you make changes to code and click on execute.. it compiles links and then shown the program in execution. My program compiles , links properly but at execution after compiling gives the assertion error. so i hit 4-5 times execute then it executes without this assertion error.
Is there anything about thread problem. My application shows splash window in the startup on different thread.
regards
Leya
|
|
|
|
|
Sounds like the problem is in the driver hands.sys
|
|
|
|
|
Hello Friends
Help is required from anybody who has done coding for http connectivity using VC++ 6.0 using MFC.
Following is the scenario wherein i am trying to connect the site by authenticating the proxy server.
Following are the steps which i am following, if i am work pls guide me out.
CInternetSession *pSession;
CHttpConnection *pConnection;
CHttpFile *pFile;
CString strObject;
CString szAuthLine;
BOOL bResult;
DWORD dwRet;
pSession= new CInternetSession
(NULL,1,INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0);
pConnection=pSession->GetHttpConnection
(_T("http://www.codeproject.com"),1,808,"girish","girish2005");
pFile=pConnection->OpenRequest(NULL,strObject,
NULL,1,NULL,NULL,NULL);
szAuthLine="girish:girish2005";
pFile->AddRequestHeaders(szAuthLine,
HTTP_ADDREQ_FLAG_ADD,strlen(szAuthLine));
bResult=pFile->SendRequest(szAuthLine,NULL,0);
Following mentioned above is the code
pls help me out.
With Rgds
Girish
Software Developer
|
|
|
|
|
I wanted to write this programes result to a file...pls tell me how..
-----------------------------------------------------------------------------
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
void DoStuff()
{
// Get the input from the user.
cout << "Enter digit: ";
string s;
cin >> s;
cout << endl;
for (int i=0; i<10000000; ++i)
{
random_shuffle(s.begin(), s.end());
cout << "Randomised: " << s << endl;
cout << " : " << s << endl;
cout << " : " << s << endl;
cout << " : " << s << endl;
cout << " "<< endl;
cout << "Single Row: " << s << " " << s << " " << s <<" " << s << endl;
cout << " "<< endl;
cout << " "<< endl;
cout << " "<< endl;
cout << " "<< endl;
}
}
int main(int argc, char* argv[])
{
DoStuff();
return 0;
}
|
|
|
|
|
Hello.
This seems to be a console app. If it is, them you can just redirect it's output to the file you want.
An example: Suppose your programs name is Program.
Start a command/DOS prompt and go to the directory of the program.
Run your program like this:
Program >outfile.txt
Now you have got a file named outfile.txt
It contains the output of your program.
|
|
|
|
|
Yes, but everything will be redirected to the file. The question for the number of digits also.
|
|
|
|
|
That's right.
I missed that part.
|
|
|
|
|
i ve to include dis in da source code...n i m using visual c++..can u help me..
|
|
|
|