|
Dj_Lordas wrote: is working some how not correctly.
How so? What is "work properly"?
Every time through the loop you overwrite the previous InstrArr value.
All those arrays never get deleted.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
True and beyond that the code makes no since to me.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
John R. Shaw wrote: and beyond that the code makes no since to me.
I'm right there with ya on that one
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
i am very beginner in c++, could you show, how to correctly delete these arrays? could you write how the good code looks like?
Dj_Lord
|
|
|
|
|
I want Instructions() to make an array and i am not sure how should I do it..
i posted just the example showing the meaning the problem, so here is the full code:
http://www.paste.lt/paste/2daf3594d0c371fa73ec80d9ad4dfcb3
maybe now it will be easier to understand..
Dj_Lord
|
|
|
|
|
You're creating the arrays fine but not deleting them
int* instr=new int[dydis];
...
delete[] instr;
I'm not sure what you are trying to do in your code.
You use new and delete so the problem is not with array creation but is with the logic of the
code.
You have to eventually call delete on any of the pointers returned by new. Those pointers could
be stored in variables, an array, etc.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I knew that we can not create multi dimensional array with new. But in Navigating C++ and Object-Oriented Design book, it writes:
Type *pname = new Type[size]; <br />
Type (*pname)[size2][sizeN] = new Type[size1][size2][sizeN];
for example:
A (*pu)[1] = new A[1][1];
delete [] pu;
Is this example code really means that this is dynamic array? Or something different?
Assume that we create N-size array, Is it always enough to write delete[]?
Thanks.
|
|
|
|
|
Hi.
With Visual Studio 2005 and .NET it's too easy to consume and create a Web Service, but what about using MFC?. I got a MFC application, (a dialog based application), and I need to consume a Web Service, (created with Visual Studio 2005 in ASP.NET), how could I do that?. I know, SOAP is the answer, but I need a guide, (maybe there's an article already writen, or something like that).
Thank you and regards.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
|
Yes Mike!
That's what I need!!. Right on target!.
Thank you.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
hey everyone. can anyone help me with setting up a texture in visual studio.
heres my code just in case thats the reason why my texture isnt showing up.
thanks everyone!!!
#include <gl glut.h="">
#include <gl glu.h="">
#include <gl glaux.h="">
#include <stdio.h>
GLuint texture;
int width, height;
BYTE * data;
FILE * file;
void changeSize(int w, int h)
{
if(h==0)
h = 1;
float ratio = 1.0*w/h;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glViewport(0, 0, w, h);
gluPerspective(45, ratio, 1, 1000);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(0.0, 0.0, 5.0,
0.0, 0.0, -1.0,
0.0f, 1.0f, 0.0f);
}
void renderScene(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_TEXTURE_2D);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glBindTexture(GL_TEXTURE_2D, texture);
glBegin(GL_QUADS);
glTexCoord2d(0.0, 0.0); glVertex3f(-1.0f, -1.0f, 0.0f);
glTexCoord2d(-1.0, 1.0); glVertex3f(-1.0f, 1.0f, 0.0f);
glTexCoord2d( 1.0, 1.0); glVertex3f( 1.0f, 1.0f, 0.0f);
glTexCoord2d( 1.0, -1.0); glVertex3f( 1.0f, -1.0f, 0.0f);
glEnd();
glFlush();
glDisable(GL_TEXTURE_2D);
}
GLuint LoadTextureRAW( const char * filename, int wrap )
{
// open texture data
file = fopen( filename, "rb" );
if ( file == NULL ) return 0;
// read texture data
fread( data, width * height * 3, 1, file );
fclose( file );
// allocate a texture name
glGenTextures( 1, &texture );
// select our current texture
glBindTexture( GL_TEXTURE_2D, texture );
// select modulate to mix texture with color for shading
glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
// when texture area is small, bilinear filter the closest mipmap
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_LINEAR_MIPMAP_NEAREST );
// when texture area is large, bilinear filter the first mipmap
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
// if wrap is true, the texture wraps over at the edges (repeat)
// ... false, the texture ends at the edges (clamp)
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,
wrap ? GL_REPEAT : GL_CLAMP );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,
wrap ? GL_REPEAT : GL_CLAMP );
// build our texture mipmaps
gluBuild2DMipmaps( GL_TEXTURE_2D, 3, width, height,
GL_RGB, GL_UNSIGNED_BYTE, data );
return texture;
}
void FreeTexture(GLuint texture)
{
glDeleteTextures(1, &texture);
}
void main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_SINGLE | GLUT_DEPTH);
glutInitWindowPosition(100, 100);
glutInitWindowSize(320, 320);
glutCreateWindow("Texure");
glutDisplayFunc(renderScene);
glutReshapeFunc(changeSize);
glutMainLoop();
}
as a seal i will never insult the constitution, to kill and not to be killed, to die and not to be....died.
|
|
|
|
|
Dear all
we have a program(binary code) . We want to make it to have high process and thread priority.
is there any function or way that we can do this from an application which we write to make that program have high priority?
Also we have one Device driver which has one kernel mode thread in it.
Is there any way to change the priority of system thread of that driver?
we have only .sys version of that driver.
Regards
Monhi
|
|
|
|
|
Hi,
Does anybody know a tool for Visual Studio .Net, for programming in C++, that when changing a class / data member / function name - it can automatically rename all references to the class / member?
Thanks!
while (i == live) {
have(fun);
}
|
|
|
|
|
google is your friend dude!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hello,
I would like to know HOW I can delete all Cookie from Internet Explorer 7.
Is there a function in the API?? I could not find anything.
Thank you in advance!!
|
|
|
|
|
shareholder771 wrote: I would like to know HOW I can delete all Cookie from Internet Explorer 7.
i don't able to find the specific function, but yes you can delete it from Internet History folder situated!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
|
You're talking about your intelligence coefficient?
Apart from spam and abuse, we need a "Report crap" link!
|
|
|
|
|
|
It was something like this:
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
so it wasnt a simple question.
|
|
|
|
|
Actually it was two smileys!
I'll let you decide if that's simple or not
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
MarkSalsbery wrote: I'll let you decide if that's simple or not
well said,but it needs to a powerful compiler for decide about it
|
|
|
|
|
brahmma wrote: Apart from spam and abuse, we need a "Report crap" link!
i second you on that!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
BOOL bValue;<br />
<br />
if (bValue)<br />
{<br />
bValue = FALSE;<br />
}<br />
else<br />
{<br />
bValue = TRUE;<br />
}
If write this code to InterLocked functions, how to write?
if (InterlockedExchange(&bValue, TRUE) = TRUE))<br />
{<br />
InterlockedExchange(&bValue, FALSE);<br />
}
Right?
Thanks.
|
|
|
|
|