I'd a problem. I want to instatite a template class like this
MaxHeap<Array<int>> m; I'm using vc++. Why it is so. The code is working if i'm changing code and using like MaxHeap<Array> m;Why it is so. How to solve this problem. Please help me in this aspect.
But compiler is giving errors like
d:\cpppractice\sep3\heap.cpp(13) : error C2146: syntax error : missing ',' before identifier 'm'
d:\cpppractice\sep3\heap.cpp(13) : error C2065: 'm' : undeclared identifier
d:\cpppractice\sep3\heap.cpp(13) : error C2143: syntax error : missing '>' before ';'
Error executing cl.exe.
heap.obj - 3 error(s), 1 warning(s)
complete code is:
# include <iostream>
# include <Heap1.h>
using namespace std;
using namespace bhadram1;
# include <iostream>
using namespace std;
//friend ostream& operator<<(ostream& ostr,String& s);
I have a MDI project.
How can I exchange data from one Editcontrol to another editcontol. I open two instances of a view.
I change the text of the Editcontrol in one view.
Afterwards, I close the view. The changed text should appear to the second view in the Editcontrol.
Can you help me please?
I suggest you start reading here[^] in the MSDN about DLL's. In order to use your object library (the .lib file) as a DLL, you may need to create a DllMain function in a .C or .CPP source file, compile it, and link it to your .lib.
You will need to research further what it takes to use a DLL from C#; that's something I don't know about.
By the way: I don't know who the two boneheads were that rated your post a 1. I think your question is valid, asked politely, and in the correct forum. Good luck.
I am using SQL Server for my database programming using CRecordset. but now i have to use Oracle. I am connecting to Oracle using ODBC. How to access tables from Oracle. Tables having BLOB datatype fields. how to access Oracle through VC++. Can u plz guide me.
You can use CDatabase and CRecordset classes for accessing the database and retrieving the records from Oracle. While passing any query when you mention the table name is sufficient, as the ODBC will be connecting to the whole of the database and tables are part of the database.
this is only a part of the code the problem wit this code is that when then chagne is store in the bugger it always change example((bugger)6.7 = (change)6.6) it always change to a diferant number so can please tell me why please
You get this problem because of the way floating point numbers are represented, and the way types are converted.
When you convert a float to an integer, for example in the statement:
bugger = (float)change * (float)100;
the float is truncated (i.e. the fractional part is discarded.)
When you multiply two floats (eg 0.67 by 100.0), the answer will not be exactly an integer (eg. 67) - it will be slightly more or slightly less. Since the result you get after truncating is 66, this implies the float representation is less than 67, i.e. 66.9999 . . . Truncating 66.99999 gives 66.
The solution - add some small number to the result before truncating, as below
While there may be a valid use for goto, I've not used it in years. You can always organize your code so that it isn't necessary, and the modified code is almost invariably more robust.
I am curious. Why were you taught to not use switch? While it can be misused, overall it has its applications. Any time you have a discrete value (an enum, for example) that specifies an action, a switch statement is appropriate.
The object-oriented programming crowd would argue that you should create a class structure, and derive unique classes for each case. That approach is inefficient and overkill a lot of the time. It also makes it a lot more difficult to follow program logic.
this SOCKHANDLE structure is used at m_clientstructArray, and m_xxx_port_sockList's node member
the problem of this my code is that Getnext returns different value at second GetNext at added 3 lines especially after comed out of func C 's while loop....
but pPortCliSkc's value returned from func B 's new has proper value....
but, func C 's added GetNext return another value.....
why this happens?
GetHeadPosition 's return value is always same but
GetNext value is different , inside of Fucn C's while loop first entered,
but come out of while loop and added Getnext's return value is different ?
I've also tried include fstream without the .h and get different errors. Any ideas? Thanks. I'm wanting to learn C++ and I have Visual Studio .NET 2003 Professional. NOt sure if the version matters, but thought I would post it in case.