Posts
 
Reputation
Joined
Last Seen
Ranked #781
Strength to Increase Rep
+7
Strength to Decrease Rep
-1
100% Quality Score
Upvotes Received
51
Posts with Upvotes
49
Upvoting Members
26
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
7 Commented Posts
4 Endorsements
Ranked #397
Ranked #425
~108.96K People Reached
Favorite Tags
Member Avatar for histrungalot

["Objects that are instances of an inner class exist within an instance of the outer class"](http://docs.oracle.com/javase/tutorial/java/javaOO/nested.html) Even though I attempt to create an independent instantiation of the inner class, the outer class is always there because of the statement above. ##Is that ture? If true, then that would also mean …

Member Avatar for histrungalot
0
174
Member Avatar for Major Aly

##You can't return a pointer from off the stack. Add the error handling #include <cstdio> #include <iostream> using namespace std; struct student { int SUB[3]; }; struct AVGPCT { float avg; float pct; }; AVGPCT* CALC(student *A) { int x,y; //--------------------------------------- // Have to allocate the memory here AVGPCT *D …

Member Avatar for histrungalot
0
347
Member Avatar for jude416

Yes, need more context. Post more. And tell us what it is doing that makes you say that it doesn't work.

Member Avatar for DeanMSands3
0
278
Member Avatar for angelineang

Read this http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html and look at the section **Rounding Error**. ##Play around with this #include <iostream> #include <iomanip> #include <cmath> // Might need this later #include <cfloat> using namespace std; int main(){ // a / b = c = c // (1/9) / (1/3) = 3/9 = 1/3 float a(1.0f/9.0f),b(1.0f/3.0f),c(1.0f/3.0f); …

Member Avatar for geojia
0
133
Member Avatar for nataraja833

You didn't allocate memory for the cell inside the INST. [code] for ( j = 0; j < i; j++ ) { top_inst_list[j] = (INST *)malloc(sizeof(INST)); top_inst_list[j]->name = (char *)malloc (sizeof(char) * 10); // You need to allocate memory for the CELL before you start to access // top_inst_list[j]->cell->name top_inst_list[j]->cell …

Member Avatar for deceptikon
0
137
Member Avatar for triumphost

##Would this work http://www.cplusplus.com/reference/std/locale/collate/hash/

Member Avatar for triumphost
0
134
Member Avatar for mchung90

##See comments in code #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <sys/mman.h> #include <sys/types.h> #include <ctype.h> //---------------------------------------------------------- // Added for fstat #include <sys/stat.h> int main(int argc, char * argv[]){ //---------------------------------------------------------------------------- // Added for fstat struct stat sb; int fd, pagesize,i; char *data, x; if (argc != 2){ //-------------------------------------------------------------------------- // Here …

Member Avatar for mchung90
0
137
Member Avatar for mike_2000_17

##If using GCC version < 4.7.0 (me 4.6.3) need to uncomment out this as Mikael Persson indicates // For GCC version < 4.7.0, use this replacement for the template alias: // template <typename T> // struct locked_ptr { // typedef const detail::locked_ptr_impl<T>& type; // }; ##And replace all locked_ptr<const std::string> …

Member Avatar for mike_2000_17
3
1K
Member Avatar for lxXTaCoXxl

If you are inserting at the front each time, DataAt(i) will always return the first element you added. Ex: InsertAtFront(22): 22 DataAt(0) = 22 InsertAtFront(33): 33, 22 DataAt(1) = 22 InsertAtFront(44): 44, 33, 22 DataAt(2) = 22 etc ...

Member Avatar for histrungalot
0
204
Member Avatar for iAndrewMeyer

> /* Memory allocation */ > array = (int**)malloc(sizeof(int) * ROWS); ##Should be /* Memory allocation */ array = (int**)malloc(sizeof(int*) * ROWS); sizeof(int) and sizeof(int *) would be different on 64-bit machine.

Member Avatar for Trentacle
0
139
Member Avatar for dyl_ham

##@dyl_ham, your last try was really close. Just move some things around. #include <iostream> #include <fstream> #include <cstdio> #include <cerrno> using namespace std; ifstream * openInputFile() { string fileName; cout << "Please enter a valid file name: "; cin >> fileName; //--------------------------------------------------- // You have the file name, just use …

Member Avatar for dyl_ham
0
1K
Member Avatar for paranoidSandra

##Try if(childpid > 0){ //parent close(pipe2[1]); close(pipe1[0]); client(pipe2[0], pipe1[1]); //--------------------------------------------------- // I moved these, you have to close the pipes // so the server can exit and then the wait // will catch the exit of the server. close(pipe2[0]); close(pipe1[1]); wait(&status); exit(0); } ##Now `while(read(readfd, am, sizeof am) > 0)` …

Member Avatar for paranoidSandra
0
121
Member Avatar for SCass2010

##This works for me and I'm using the same g++ (gcc version 4.1.2 20080704).## #include <iostream> using namespace std; typedef int DOMNode; class MyDOMNode { public: MyDOMNode (DOMNode* node): mDomNode (node) { cout << "Constructor: " << node << endl; } bool operator== (const MyDOMNode& rhs) { if (mDomNode == …

Member Avatar for deceptikon
0
160
Member Avatar for Crynix

##See if this helps, look at comments.## #include <iostream> #include <string.h> #include <sstream> using namespace std; struct Item { string itemDescription; int quantity; float wholesaleCost, retailCost; string dateAdded; }; int main(){ Item temp; //file.read((char*)&temp.itemDescription, readsize); //####################################### // Comment this out for this to work read(1,(char*)&temp.itemDescription,4); //##################################################### // // temp.itemDescription // …

Member Avatar for histrungalot
0
349
Member Avatar for mcjiwe

##See if this helps, look at the comments.## #include <string.h> #include <stdio.h> //####################################### // This must be what your structure // looks like struct { char *nome; char *identificadorNum; char *quantStock; char *limMin; char *consumoMed; } ingredientes[4]; //####################################### // This is what it should look like struct { char nome[10]; …

Member Avatar for mcjiwe
0
138
Member Avatar for 9tontruck

Just ran you code and it worked for me: #include <iostream> #include <string> #include <cstdio> #include <curl/curl.h> int main(void) { CURL *curl; curl = curl_easy_init(); if(!curl) { std::cout << "Unable to initialize cURL interface" << std::endl; return -1; } std::string curl_url = "https://www.cia.gov/"; curl_easy_setopt(curl, CURLOPT_URL, curl_url.c_str()); curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcurl-agent/1.0"); curl_easy_setopt(curl, …

Member Avatar for 9tontruck
0
3K
Member Avatar for coutnoob

I don't think you want to have it scoped to the Circle class. If it was then you wouldn't have to be a friend.

Member Avatar for histrungalot
0
347
Member Avatar for Lucaci Andrew

When you get to it, void B::add(int id, string name, int age){ A *a; a=new A; a->setid(id); a->setname(name); a->setage(age); list.push_back(*a); } is leaking memory. You define list as `vector<A> list;` and in the add function allocate memory for an A class but when you add it to the list it …

Member Avatar for gusano79
0
709
Member Avatar for haris riaz

Using a recursive function as well. I just have one more bug (I think). I thought that function was getting to complex but maybe not. Got to solve it, it's consuming me now.

Member Avatar for histrungalot
0
160
Member Avatar for risen375

Change line 223 from `dobule weightInKg = convertLbToKg(weight);` to `weightInKg = convertLbToKg(weight);` You defined weightInKg at line 201 and then again at line 223 but then you used it in 275. But were you set it at line 223 is a different scope then the one defined at 201.

Member Avatar for histrungalot
0
127
Member Avatar for Z33shan

What do the values in the matrix represent? And why is T1 -> p1 T2 -> p2 T3 -> p3 T4 -> p1 the best? Trying to understand your problem a little more.

Member Avatar for raptr_dflo
0
296
Member Avatar for jwill222

> I tried to do linear probing in the above ... Looking at the link you gave, it looks like they want you to use link-lists for the collisions because in the section were it talks about >b. when requested, analyze the efficiency of the hashingalgorithm for this set of …

Member Avatar for jwill222
0
609
Member Avatar for pattilupwned
Member Avatar for histrungalot
0
189
Member Avatar for saneeha.nust

Should `generate_combination()` be an operation of the class bruteFrce? Like `void bruteFrce::generate_combination(int)` or should it really be outside the scope of the class bruteFrce?

Member Avatar for histrungalot
0
246
Member Avatar for pattilupwned

Use erase: http://www.cplusplus.com/reference/string/string/erase/ `string& erase ( size_t pos = 0, size_t n = npos );` "pos: Position within the string of the first character to be erased." "n: Amount of characters to be removed." void setSecretCode (char code[4]) { string colors = "RGBYO"; int pos; srand(time(NULL)); pos = rand() % …

Member Avatar for pattilupwned
0
307
Member Avatar for histrungalot

##I was working on something and saw this oddity, thought I would share it. $ ./a.out in.val = 86.3115158 -> Its a valid floating point number out1.val = nan -> Swapped it and now its a NaN! That's OK swap it back. out2.val = 86.4365158 -> What, its not the …

Member Avatar for histrungalot
0
176
Member Avatar for FraidaL

Its wraping around. $ ./a.out i(0) f1(9) f2(-8) <------ Should have stopped here i(1) f1(12) f2(-6) i(2) f1(18) f2(-4) i(3) f1(24) f2(-3) i(4) f1(36) f2(-2) i(5) f1(72) f2(-1) i(6) f1(-72) f2(1) i(7) f1(-36) f2(2) i(8) f1(-24) f2(3) i(9) f1(-18) f2(4) i(10) f1(-12) f2(6) i(11) f1(-9) f2(8) <------ When all of …

Member Avatar for histrungalot
0
635
Member Avatar for bgx90

You forgot to put the RefEnv:: infront of the two functions get_var and get_func. std::map<std::string, VarIdent>::iterator RefEnv::get_var(std::string s){ std::map<std::string, FuncIdent>::iterator RefEnv::get_func(std::string s){ And you have the wrong type for the second map template para. bool RefEnv::insert_func(Type t, std::string key, std::string n){ //Precondition: // A RefEnv object exists // //Postcondition: // …

Member Avatar for bgx90
0
3K
Member Avatar for phorce

##Try, but only tested it a little #include <vector> #include <iostream> using namespace std; int main(){ vector<int> m1,m2,m3; m1.push_back(0); m1.push_back(1); m1.push_back(1); m1.push_back(0); m1.push_back(0); m1.push_back(1); m1.push_back(1); m1.push_back(1); m1.push_back(1); m1.push_back(0); m1.push_back(1); m1.push_back(1); m1.push_back(0); m1.push_back(0); m1.push_back(0); m1.push_back(1); m2.push_back(0); m2.push_back(1); m2.push_back(0); m2.push_back(1); //------------------------------------------ // Just thinking // 1 2 3 4 5 6 // …

Member Avatar for histrungalot
0
175
Member Avatar for SillyNoob

Not at home to check it out but I pretty sure that your problem is, you are returning a pointer to something on the stack. ScoreEntry** retEntry = &newEntry; return retEntry; newEntry is a local variable and when you leave the Load function its address is no longer valid. Why …

Member Avatar for SillyNoob
0
91