|
Actually, all I need to do is make the tcb variable static, as in
static TcbDriver::TCB tcb;
Gary
|
|
|
|
|
I have the following code.
Why does not my x is displayed.
I do not understand, X is returned by the getX() function wich is called from the derived class SecondClass() through an object of type FirstClass().
Initialization of X was done using constructor function FirstClass(int x).
I did not want to use the initialization function like setX ().
#include <iostream>
using namespace std;
class FirstClass
{
private:
int x;
public:
FirstClass()
{
cout << "\n Default constructor FirstClass()." << endl;
}
FirstClass(int x)
{
cout << "\n Constructor FirstClass()." << endl;
this->x = x;
cout << "\n X = " << x << endl;
}
int getX()
{
return x;
}
};
class SecondClass:protected FirstClass
{
private:
int y;
public:
SecondClass(int x):FirstClass(x)
{
cout << "\n Constructor SecondClass()." << endl;
}
void printX(FirstClass& obj)
{
cout << "\n X = " << obj.getX() << endl;
}
};
int main()
{
FirstClass box1;
SecondClass box2(100);
box2.printX(box1);
return 0;
}
|
|
|
|
|
Please do not post the same question in multiple forums.
|
|
|
|
|
please help me on how to extract audio from video.
|
|
|
|
|
That is a question for Google.
|
|
|
|
|
In Microsoft Visual C++ how to use sub threads to achieve similar CListCtrl ?
|
|
|
|
|
I am a student of BS(CS) "Computer Science" .
I have a project of "AES Code implementation in C++" and i have submit that project on 28 JUNE 2016
I have a technical issue in my code
Only serious programmers were needed. I can provide any sort of help (to understand my code)
thank you
|
|
|
|
|
This is exactly the same "question" you posted in the thread immediately below, and again in QA earlier this week.
Reposting the same demand for free consultation over and over again will get you banned from this site.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
i am providing you a link in which there are five files and it contain the comments which could help you to understand my code
the link is
https://drive.google.com/open?id=0B11e8mZUoCQwdzdaUVh3QVoyZTg
please check these files and inform me that where is the logical error in the program
you can email me on
"ammadyousafciit@gmail.com"
thank you very much
|
|
|
|
|
Sorry but no one is going to download your project and debug it for you.
|
|
|
|
|
can you tell me the reasons
|
|
|
|
|
Because this is an open forum for answering questions, not for doing other people's work.
|
|
|
|
|
Hello, This Taiming and I am a serious C++/MFC developer with 15 years experiences.
Please let me know what problems you have met in AES encryption.
|
|
|
|
|
i am having trouble in AES code implementation in c++.Can any one help in c++ coding point of view
thank you
|
|
|
|
|
|
i have seen these web pages and code it according to that algorithm
i am now in final position in that code and the problem is that it is not encoding correctly and decoding as well so could you help me in that case
thank you very much
|
|
|
|
|
Without seeing your code neither I nor any other here can help.
If you just need working code, use an existing implementation.
Otherwise show your code and what you have tried / where it fails. To do this, edit your question and add the relevant code formatting it using the 'code' option above the edit window (should be not too much code).
Another tip is using an existing implementation with the same arguments and comparing the results. So you can detect if encryption, decryption or both are failing.
|
|
|
|
|
[Note: Enquirer has send a mail to me containing the code]
You had asked for help in a public forum. Then you should let others participate in the discussion.
But the complete code would be too much to be posted here and I have no time to step through that amount of code. Especially because it does not contain comments and begins with the inclusion of other source files which is bad C/C++ style.
If you find someone who can help you should at least tell which of these "web pages" has been used by you and which code parts has been written by you or has been copied.
|
|
|
|
|
Write a simple expression evaluator that takes a string like the following as input: 1+2*(3+4).
-Only integers need to be supported
-The following operators should be supported: +, -, *.
-Expressions within parenthesis should be evaluated first.
-Then the resulting expressions should be evaluated from left to right (no operator precedence)
-Example:
4+(4-(2*3)+1)+4 = 7
The code should be written in such a way to support additional operators.
Assume the existence of a function tokenise, which could take a string and return an array of strings, for instance
tokenise(‘1+(2*3)+4’) would return [‘1’,’+’,’(‘,’2’,’*’,’3’,’)’,’+’,’4’]
and the functions isNumber and asNumber which would return a Boolean and integer respectively on a single string input.
modified 17-Mar-16 14:43pm.
|
|
|
|
|
Your homework should serve the purpose that you learn something. And that something isn't supposed to be how to get other people to doing your homework for you.
Your assignments will get more difficult over time - so if you don't start doing them yourself now you'll never be able to.
So sit down, think about it and try something. If you then encounter a specific problem, feel free to ask - that's the idea of these forums.
Also, there are a lot of articles here on CodeProject about expression evaluation. Take a look at those if you struggle to find a starting point.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
|
|
I use Visual Studio 2012 and Microsoft DirectX SDK (June 2010). I created an applicatin with a 3d cube as an object. In the example that I use it is moved the point of view of the camera.
In my case I would like to move the object by the keaboard along X and Y axis without moving the camera view.
Could you please help?
Here is my code:
...
CubeDemo::CubeDemo(HINSTANCE hInstance, std::string winCaption,
D3DDEVTYPE devType, DWORD requestedVP)
: D3DApp(hInstance, winCaption, devType, requestedVP), MAX_SPEED(1500.0f), ACCELE(1000.0f)
{
// 5 units off the ground.
mCameraHeight = 5.0f;
buildVertexBuffer();
buildIndexBuffer();
onResetDevice();
InitAllVertexDeclarations();
}
...
void CubeDemo::updateScene(float dt)
{
// One cube has 8 vertices and 12 triangles.
gDInput->poll();
// Check input.
if( gDInput->keyDown(DIK_W) )
{
// Code for moving the 3D object along X axis???
}
if( gDInput->keyDown(DIK_S) )
{
// Code for moving the 3D object along Y axis???
}
buildViewMtx();
}
void CubeDemo::buildViewMtx()
{
D3DXVECTOR3 pos(10, 0, 10);
D3DXVECTOR3 target(0.0f, 0.0f, 0.0f);
D3DXVECTOR3 up(0.0f, 1.0f, 0.0f);
D3DXMatrixLookAtLH(&mView, &pos, &target, &up);
}
void CubeDemo::drawScene()
{
HR(gd3dDevice->Clear(0, 0,
D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0));
HR(gd3dDevice->BeginScene());
HR(gd3dDevice->SetStreamSource(0, mVB, 0, sizeof(VertexPos)));
HR(gd3dDevice->SetIndices(mIB));
HR(gd3dDevice->SetVertexDeclaration(VertexPos::Decl));
D3DXMATRIX W;
D3DXMatrixIdentity(&W);
HR(gd3dDevice->SetTransform(D3DTS_WORLD, &W));
HR(gd3dDevice->SetTransform(D3DTS_VIEW, &mView));
HR(gd3dDevice->SetTransform(D3DTS_PROJECTION, &mProj));
HR(gd3dDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME));
HR(gd3dDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, 8, 0, 12));
HR(gd3dDevice->EndScene());
HR(gd3dDevice->Present(0, 0, 0, 0));
}
Reagards
|
|
|
|
|
You move an object by repainting it at successive different points of the view screen.
|
|
|
|
|
I know but I need any example or tutorial easy to import in my code.
|
|
|
|