here is my question why is this need to be => private:
int ages;
need to be public ?
also do i need need to put this?
what happen if forget about that?
Jose Kampilan wrote:
i've tried removing the asterisk from the iterator (i.e. deletion = w)
Jose Kampilan wrote:
and also tried to copy the syntax of the example from list::erase C++ (w = input.erase(w)) but sadly both of them didnt work.
J Shankar wrote:Please help me to understand "how the pointer is represented for Char and String" in the above scenario.
Mahesh Chandran wrote:Hi all,
I am put together the following code segments from his book.
#include <iostream>
#include <map>
#include <string>
#include <iterator>
using namespace std;
map<string, int>histogram;
void record (const string &s)
{
histogram[s]++; //record frequency of "s"
cout<<"recorded:"<<s<<" occurence = "<<histogram[s]<<"\n";
}
void print (const pair<const string, int>& r)
{
cout<<r.first<<' '<<r.second<<'\n';
}
bool gt_42(const pair<const string, int>& r)
{
return r.second>42;
}
void f(map<string, int>& m)
{
typedef map<string, int>::const_iterator MI;
MI i = find_if(m.begin(), m.end(), gt_42);
cout<<i->first<<' '<<i->second; //this gives an error Exception: STATUS_ACCESS_VIOLATION
}
int main () {
istream_iterator<string> ii(cin);
istream_iterator<string> eos;
cout<<"input end\n";
for_each(ii, eos, record);
//typedef pair <string, int> String_Int_Pair;
//histogram.insert(String_Int_Pair("42", 1));
//histogram.insert(String_Int_Pair("44", 1));
//for_each(histogram.begin(), histogram.end(), print);
f(histogram);
}
I get an error - Exception: STATUS_ACCESS_VIOLATION, I think in the referencing i->first, i->second, I guess. Can someone help me out find out what the issue might be. Also if you can suggest some alternate C++ forums that will be helpful as well.
Punit Jain wrote:can you suggest me any good book for c and c++??
Punit Jain wrote:i want to know how do i create linked list using array, and how can i create array using linked list???
with example...
Robert Heath wrote:I wonder if there would be a scheduler for Java to be in the JVM in addition to the scheduler for the native OS. Plus where do the concurrency primitives live for Java, in the JVM or the native OS? In C++ I would expect to see the only scheduler to be in the OS. But I really don't know.
Has anyone seen performance benchmarks to measure the time from suspending one process, because of concurrency primitives (like semaphores), and beginning the next process in C++ and Java.
Ankit Yadav wrote:not exactly NUMA, or may be, I have little knowledge about NUMA
i think i forgot to mention that I were talking in reference to multi-core/processor system, with having both shared & exclusive memory/cache.
I am asking that, how does the memory hierarchy say RAM, L1/L2/L3 cache, affects the concurrency model, especially in terms of performance & data integrity?
moreover, does having more leyers of either shared-memory or non-shared-memory has any effect over the performance of overall system?
Ankit Yadav wrote:thanks for your valuable response. One more doubt I am having is that,
how does the different level/hierarchy of exclusive memory and shared-memory restricts/facilitates the implementation of concurrency?
Tina Smith wrote:What's different about threading/concurrency in C++11 vs previous versions?
Tina Smith wrote:Is there any functionality that Java or C++ provides over the other as far as concurrency is concerned?
Which, in your opinion, is easier/better to use?
Hussein Baghdadi wrote:Hi,
How do you compare C++11 concurrency support to Grand Central Dispatch?
Any plans or possibilities to include GCD as a part of C++11?
Thanks.
Pradeep bhatt wrote:It has been several years since I worked on cpp. Where can I gets started. which free cpp software can i download ? I am using a windows 7 laptop.