|
Hello,
can someone help me to remove a item from a vector?
I try to use vector::erase(vectoritem); but i resive an error!
Thanks
termal
|
|
|
|
|
This is not much to go on. What error message? What data types are you using for the short sample code shown?
Here is an example
<br />
std::vector<int> intvec;
<br />
intvec.push_back(23);<br />
intvec.push_back(24);<br />
<br />
intvec.erase(intvec.begin());<br />
Hope that helps.
I Dream of Absolute Zero
|
|
|
|
|
termal wrote: but i resive an error!
Which error ?
|
|
|
|
|
Hi all:
I have been given a quiz:
If I want to make a local function visible from outside of the file in which it is declared. I should make this function ________.
Can anyone help?
Thank you
|
|
|
|
|
C_Zealot wrote: If I want to make a local function visible from outside of the file in which it is declared. I should make this function ________.
Not static I guess. But I'm not sure what you mean by a local function.
codito ergo sum
|
|
|
|
|
Public ?
I Dream of Absolute Zero
|
|
|
|
|
You don't have to do anything at all in the file where the function is written.
<br />
void AFunc(int& i)<br />
{<br />
}<br />
<br />
<br />
extern void AFunc(int i);<br />
<br />
int BFunc(void)<br />
{<br />
int i = 6;<br />
AFunc(i);<br />
return i;<br />
}<br />
It's the C way of doing things but it works just fine in C++. Often the prototype is actually in a header file so you can pull in lots of functions with one #include
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Matthew Faithfull wrote: You don't have to do anything at all in the file where the function is written.
But you can't make the function static, I believe
Matthew Faithfull wrote: //somecode.cpp
static void AFunc(int& i)
{
//Do Stuff
}
Because that would hide the function and bind it to the local scope, being the file where its defined.
-- modified at 4:11 Tuesday 19th June, 2007
codito ergo sum
|
|
|
|
|
Yes, as far I know you are correct.
I would ask please don't alter the text of quotes. In this case with the highlight and as it's code I don't mind but if it was ordinary prose you were quoting I would be quite upset.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Ok will take the advice into account.
Didn't though it over that I was changing someones quote.
Guess I was in a hurry.
codito ergo sum
|
|
|
|
|
Thank you.
I think this is what I need.
|
|
|
|
|
Fill in the blank? One word?
"global"
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
When I try to builder a aplication on VC++
I see error below:
"Microsoft Visual Studio C Runtime Library has detected a fatal error in devenv.exe"
How to fix ?
tuongnd
|
|
|
|
|
Thanks.
I found error.
I reinstall visual studio 8.
After then build seccessfull
tuongnd
|
|
|
|
|
HELLO to every one..
my question is how i can switch from one menu window to another?
help me plz ..
vikram..
|
|
|
|
|
will you be more specific?????
Ashok
|
|
|
|
|
thanks ashok..
actually my question, two menu windows are there..
if i click one menu item from one window , I have to get a another menu window ?
will it b possible?
help me..
vikram..
|
|
|
|
|
What is a menu window?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I Write an ActiveX control by VC,add a custom property XXX,it is tested ok with VC's test container,but when i use it in another project,a fatal error occurs the moment i change the XXX's value,can you tell me why?Thanks very much!
|
|
|
|
|
Hello,
I want to change the background color of menu bar, tool bar and status bar as it is shown in Office any ideas?
Thanks for your time
Blr Boy
|
|
|
|
|
|
Thanks it is fine for menu item. I am looking for menu bar, status bar and mainframe window (mostly with out using skins)
|
|
|
|
|
Hello to every one..
my question is i had created one menu dialog box..
i want to call a another menu dialog box from the existing one...
whether i have to create a new class r else i have call the another one simply..
help me..
vikram..
|
|
|
|
|
Do you want to call a dialog of other dialog?
|
|
|
|
|
actually i want to call a menu window from one to another..
thanks a lot from u for my queries..
|
|
|
|