344 Posted Topics
![]() | Re: You need to put `OSOBA o;` in the scope of the `while` loop and reset the stringstream. while(getline(ifsSubor, sRiadok)) { // scope OSOBA instance OSOBA o; ss << sRiadok; ss >> o.meno; ss >> o.priezvisko; while (ss >> bod) { o.body.push_back(bod); } // reset ss ss.str(std::string()); ss.clear(); osoby.push_back(o); } In … |
Re: Start out simple and build on your code from there. Use a for (int i = 0; ...) loop Check if each array at index i has a value of zero, if it does then print the index. Once you've got that part done, you can use a while loop … ![]() | |
Re: > The "file missing" logs are probably the most indicative that you have been seriously hacked, and should NOT be running this system as-is now. No, the "file missing" entries are indicative of WOW64 redirection. HijackThis is terribly outdated and shouldn't be used on 64 bit systems. For serious malware … ![]() | |
Re: `vector<vector<PCB> > printers(3, vector<PCB>()); // 3 vectors` | |
![]() | Re: In the hpp file you have: #define ROW_LENGTH 4 int correctAnswer[ROW_LENGTH-1]; // correctAnswer[3] int userSolution[ROW_LENGTH-1]; // userSolution[3] Meaning that correctAnswer[3] is out of bounds for the array and therefore due to memory alignment has the same address as userSolution[0]. |
Re: Post the code that you have, it saves us all from playing guessing games. | |
Re: This should work, I'll leave it to you to play 'spot the difference' #include <iostream> #include <string> #include <ctime>// clock_t, clock, CLOCKS_PER_SEC unsigned int timer() { return clock(); } int main() { std::string hello = "Wake up Neo..."; unsigned int pos = 0; unsigned int milli = 0; unsigned int … | |
Re: > The code runs fine without any modification!!! You may think it does, but it certainly doesn't. Put a cout message before the call to growArray: if ( size == next_element + 1 ) { // now all we need to do is implement growArray cout << "\nCalling growArray()\n"; p_values … | |
Re: At line 63 you have `cout << CorpData;` You need to use an instance of CorpData, for example `cout << West;` You'll also need to set the precision when you output the data seeing as it contains double precision values. If you add `limits` to your includes, then the function … | |
Re: > how can i validate the Speak() function without re-declare it inside of Cow class? The only way I can think of is to make the base class Speak() function non-virtual, so that every derived class inherits the same func. class Animal { public: void Speak() { cout << "Generic … | |
Re: Something like this? hbrBackground = CreateSolidBrush(RGB(241, 245, 251)); // case WM_PAINT: { LPPAINTSTRUCT lpps = new PAINTSTRUCT; HDC hdc = BeginPaint(hWnd, lpps); FillRect(hdc, &lpps->rcPaint, hbrBackground); // other code } | |
Re: What compiler are you using? Are you building it as Win64? | |
Re: Also, 5 is never counted because arr[5] is out of bounds. | |
Re: > If my friend logic is correct then why I am getting always 0 from random(2), why not getting 1 atleast once out of 37 execution of the code. You never seed the random number generator with a call to `randomize()`, therefore you will always get exactly the same result … | |
Re: As well as sepp2k's advice, you're coming across one of the common problems associated with declaring `using namespace std;` Remove the namespace and change your function to `int stringConvertInt(std::string raw)` and then there won't be any ambiguity as to which pow function is to be used. | |
Re: The code where you read name: ch = infile.get(); while(true) { if(isdigit(ch) || ch == '\n') break; else word += ch; ch = infile.get(); } > textfile looks like this: > Apple Juice 1.50 20 In your code, you read the name as a series of single characters and break … | |
Re: At line 42 you have: `int largest = a[100];` which is out of bounds for the array. Set largest to `a[0]` At line 45, you're checking the wrong condition, you need to check whether the value is greater: `if (a[i] > largest)` Seeing as smallest and largest are (now) initially … | |
Re: You need to move the prompt for Numbers (lines 8 and 9) to inside the `y` loop. line 14 should be: `sum += n;` After that you'll need to [flush the input stream](http://www.daniweb.com/software-development/cpp/threads/90228/flushing-the-input-stream). | |
Re: One of my dogs had an ear infection and the odour was exactly as you've described. The only treatment was with antibiotics. These infections can cause a dog an awful lot of pain if left untreated, so I'd recommend taking him to the vet ASAP. Your nose and the dog … | |
Re: There's no obvious error in the snippet of code you've posted. A complete working example based on your code: #include <iostream> int main() { using std::cout; using std::endl; const size_t length = 26; const char alphabet[length] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', … | |
Re: typedef char alphabet[26]; alphabet alpha = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' }; What you could do is iterate through the text that you read in and use a … | |
Re: line 18: `int Main()` should be int main() - note case sensitivity. Also you never call your rollDice function, so you'll never know the roll count. line 29: does nothing, seeing as you are not getting input for `y` from the console. Can you work out how and where to … | |
Re: For sources, just google for linux ntfs source code, or look at the source for any linux distro. | |
Re: I'm about to go to bed, so I've not commented much of the code. You also need to write a function to free the memory used by each node. Here's your code, with the global variables moved to inside main() #include <iostream> //#include <conio.h> //#include <algorithm> //for brevity only using … | |
Re: Are you calling SendInput like this: int screen_x = GetSystemMetrics( SM_CXVIRTUALSCREEN ); int screen_y = GetSystemMetrics( SM_CYVIRTUALSCREEN ); INPUT input = {0}; input.type = INPUT_MOUSE; input.mi.dx = (x * 65535) / screen_x; input.mi.dy = (y * 65535) / screen_y; input.mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE; UINT ret = SendInput( 1, &input, … | |
Re: Follow Schol-R-Lea's advice regarding fixing the conversion functions. For the code you posted above, remove the do while loop from `void Screen_Header()` and simplify it to: void Screen_Header() { clrscr(); gotoxy(1,3); printf("Conversion from any base to base 10"); gotoxy(1,5); printf("a - Binary"); gotoxy(1,6); printf("b - Octal"); gotoxy(1,7); printf("c - Hexadecimal"); … | |
Re: See if you can get a hold of the Windows 8 "Use now and serve me a subpoena later" edition. | |
Re: What operating system are you running and is it 32 or 64 bit? What anti-virus is installed? To get started, download and install [Malwarebytes Anti-Malware](http://downloads.malwarebytes.org/mbam-download.php), let it update the database, then run a Quick Scan. Allow it to quarantine anything detected and reboot to complete disinfection. Attach the log file … | |
Re: Try running scans with [AdwCleaner](http://www.bleepingcomputer.com/download/adwcleaner/dl/125/) and [Junkware Removal Tool](http://www.bleepingcomputer.com/download/junkware-removal-tool/dl/131/). Post back if these don't get rid of it. | |
Re: @Solomon bekele, do not hijack someone elses thread. Please start your own thread and provide the code you have written so far. @neyoibarra, have a look at the functions referenced at http://www.cplusplus.com/reference/cctype/ > or if he tries to press a number nothing will come up on the program, almost as … | |
Re: It should be `itemtype::itemtype()` (case sensitive) | |
Re: Here's some code I threw together that demonstrates what you're looking to do. int main() { using std::cout; using std::endl; using std::cin; const int bufsize = 100; const int max_pwd = bufsize - 1; char password[bufsize]; // = {0}; password[0] = '\0'; cout << "Enter the password: "; for (int … | |
![]() | Re: [This tutorial](http://win32assembly.programminghorizon.com/tut2.html) explains the steps needed to link a simple MessageBox program. ![]() |
Re: This sounds like a ZeroAccess infection. Run a scan with RogueKiller and post the log file. For 32 bit OS - http://www.adlice.com/softs/roguekiller/RogueKiller.exe For 64 bit OS - http://www.adlice.com/softs/roguekiller/RogueKillerX64.exe Also post the log from Malwarebytes as suggested in the above post. | |
Re: Download from http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=al-74850-1&cc=au&dlc=en&lc=en&os=4063&product=3390947&sw_lang= | |
Re: Use `std::getline(cin, deleteMovie);` At present, if you entered 'when i met your mother(2009)', only 'when' would be read into deleteMovie. The behaviour you see after that is because the input stream isn't empty. Refer to http://www.daniweb.com/software-development/cpp/threads/90228/flushing-the-input-stream Also, remove the calls to `main()` from your switch cases. Never use recursive calls … | |
Re: Read [this](http://en.cppreference.com/w/cpp/language/operator_incdec). | |
![]() | Re: Try using `FormatSettings.LongMonthNames[12]`. I assume you declared S as a String. ![]() |
Re: Would something like the following fit the requirements? std::string str = "455454554"; std::cout << "*-" << str.substr(str.size() - 4, std::string::npos) << std::endl; | |
Re: At line 12 you've declared an iterator: `vector<int *>::iterator itr = ptrList.begin();` So just use it to iterate through the vector. vector<int *>::iterator itr = ptrList.begin(); for( itr; itr < ptrList.end(); ++itr ) { cout << **itr << endl; } | |
Re: `cout << *static_cast<int*>(test);`, in what way doesn't this print the int value "in a string way"? > imagine that int is 200, i want print 200, but in a string way Do you mean that you want to store the int value in a std::string? int i = 12; void … | |
Re: Line 17: `cout << *itr << endl;` *itr is of type Integer, so what you want is the value member of class Integer `cout << static_cast<Integer>(*itr).value << endl;` | |
Re: Seeing as in [this post](http://www.daniweb.com/software-development/c/threads/467246/exit-and-clrscr-not-declared-in-the-scope#post2035097) you just copy/pasted from [wiki answers](http://wiki.answers.com/Q/C_program_for_set_union_and_intersection_operations#slide2), I suggest that you study and learn from what you posted. Once you do that, there'll be no reason to ask this question. | |
Re: The inner loop should be `for (int j=i; j>0; j--)` Your logic is correct, though the sum will only apply for 1 + 2 + ... + 1039 = 540,280 ct1 could be written as: int ct1 = 0; for (int i = 0; i < 1040; ++i) ct1 += … | |
Re: In Student class change setDate to: void Student::setDate(Date x) { this->birthdate = x; } Then in main() after setting the members of Date you need to call: a[i].setDate(d); I assume that checking for valid data wasn't a requirement. eg integer overflow, inputting a string etc | |
Re: There's a work around that enables you to download and save the 8.1 ISO to external media. Details at http://www.neowin.net/news/here-is-how-to-get-the-windows-81-iso-and-create-a-usb-install-stick | |
Re: line 17: Should be `double sum = 0;` line 28: You can't return 2 parameters #include <stdio.h> #include <stdlib.h> double average(int arrx[6], int *ptr); int main(void){ int arry[6]= {2, 5, 4, 5, 6, 7}; int count = 0; double avg; avg = average(arry, &count); printf("The average is %.2f\n", avg); printf("The … | |
Re: > Is there any way to retrieve? Not this time. To retain your tabs, go into CCleaner preferences and uncheck the Firefox preference 'Session' |
The End.