Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
82% Quality Score
Upvotes Received
15
Posts with Upvotes
12
Upvoting Members
12
Downvotes Received
3
Posts with Downvotes
3
Downvoting Members
3
3 Commented Posts
0 Endorsements
Ranked #2K
~30.9K People Reached

41 Posted Topics

Member Avatar for Ancient Dragon
Member Avatar for Tycellent
Member Avatar for wafa_1
0
295
Member Avatar for Sarkurd

Hello. I have a few Qs about Hash tables. how does `std::hash` return a `std::size_t`? for example how does it convert a `std::string("Hello")` to `std::size_t`? How do these functions work? i have no idea what's `hash_combine` and `seed` do in `hashval.hpp` This is from STL 2nd edition. hashval.hpp #include <functional> …

0
137
Member Avatar for Sarkurd

Hi It's been a while i'm learing C++ but still i have some issue with `Move semantics` and some other stuff. I wrote this class but i don't know why the `Copy constructor` is getting called and the output is a little strange to me, shouldn't the `Move Constructor` gets …

Member Avatar for Sarkurd
0
282
Member Avatar for chilly_peppers
Member Avatar for Sarkurd

I have some confusion about Copy Constructor. Why this program crashes if we remove Copy Constructor `MyString`? #include <iostream> #include <cstring> using namespace std; class MyString { private: char* Buffer; public: // constructor MyString(const char* InitialInput) { cout << "Default constructor: creating new MyString" << endl; if(InitialInput != NULL) { …

Member Avatar for Sarkurd
0
292
Member Avatar for nitin1

`namespaces` is like a cointainer to hold all your classes, function...etc its specially used to prevent name conflicts. you may work on a project with someone and may both of you have a class or function with same name so you can use namespaces to prevent that. like C++ standard …

Member Avatar for Itecg
0
275
Member Avatar for moaz.amin.37

For checking a letter if capital we use `std::isupper`. `std::toupper` used to convert lower letters to captital. std::string str("Hello"); int count = 0; for(int i = 0; i != str.size(); ++i) { if(std::isupper(str[i])) ++count; }

Member Avatar for Sarkurd
0
656
Member Avatar for shahab saeed

Your code is a little complex for me. The `Node` is responsible for holding data not adding, deleting or displaying. Each Node in your code now has its own funtions and i don't think its a good way. Make a Display funtion in List to display all `Nodes`, pretty simple …

Member Avatar for tinstaafl
0
146
Member Avatar for Sarkurd

Hi I have tried to implement Linked-List data structure and i was folowing a guide but i have an `error` in line 12 in `contactlist.h` I have included `contact.h` properly but still not working :-/ contact.h #ifndef CONTACT_H #define CONTACT_H #include <iostream> #include <string> #include "contactlist.h" class Contact { private: …

0
101
Member Avatar for yeyo_1
Member Avatar for yeyo_1
0
185
Member Avatar for Nana_29
Member Avatar for Tycellent
Member Avatar for Sarkurd
0
681
Member Avatar for Gusani_1

`@uonsin` do you think its important to put `virtual` keyword in class B and C? I thought just the base class needs `virtual`.

Member Avatar for DonnSchwartz
0
214
Member Avatar for tentrabyte

Where is `int main()`? put it before line 5 #include <iostream> #include <string> using namespace std; int main(){ //write everything here return 0 }

Member Avatar for Sarkurd
0
2K
Member Avatar for Sarkurd

Hi I wrote a Singleton class but i got an error while controlling instantiation captain.h #ifndef CAPTAIN_H #define CAPTAIN_H #include <iostream> #include <string> class Captain { private: Captain(); Captain(const Captain&); Captain &operator=(const Captain&); std::string name; public: //Controll Instantiation static Captain &GetInstance(); //Set Name of the Captain std::string GetName(); //Get his/her …

Member Avatar for Sarkurd
0
190
Member Avatar for muhammad.husnain.5099

std::string names[10] = {"name", "name", "name", "name", "name", "name","name", "name","name", "name"};

Member Avatar for Sarkurd
0
75
Member Avatar for andrew mendonca

You shouldn't use `else if` and `else` while you have to let the function check all coneditions and swap the values if the condition true. also your conditions aren't correct. it will be easier if you put the swap functions outside then check for ascending and descending and while its …

Member Avatar for ryantroop
0
229
Member Avatar for Sarkurd

Hello I use MinGW 4.8.2 and Qt IDE i tried to use `gprof`, I added the following flags QMAKE_CXXFLAGS_DEBUG += -pg QMAKE_LFLAGS_DEBUG += -pg to `.pro` file and extarcted the `gmon.out` file but i don't know how to convert it to a `.txt` file. the document say gprof options [executable-file …

Member Avatar for Sarkurd
0
362
Member Avatar for AZERIOMON

Your header and your function declarations are fine except the last one `string toString` what do you need this one for? now just write function definations. for the constructor Record::Record (int b){ if(b < 0) balance = 0; else balance = b; } for the `void addBalance(int)` you have to …

Member Avatar for Sarkurd
0
309
Member Avatar for Ivzirnalsradeys

Don't expect to get the answer while you haven't tried to solve it by yourself. Show what you have done so far...

Member Avatar for Taywin
0
236
Member Avatar for iqra aslam

Division by two with reminder. divide `%` the number by two till reaches Zero if the reminder is no-zero, save 1 else save 0. then write binary number from button to above. now you can write the code easily with `for`loop and `if` statement.

Member Avatar for Sam_6
-1
228
Member Avatar for tan.revilleza
Member Avatar for andrew mendonca

Its the easiest way i can do. #include <iostream> #include <algorithm> // for swap using namespace std; int main() { int a = 0, b = 20, c = 128; if (b > c) swap(b, c); if (a > b) swap(a, b); if (b > c) swap(b, c); cout << …

Member Avatar for Taywin
0
3K
Member Avatar for iqra aslam

turbo c++ is too old, i bet nobody use it try a new compiler, Visual Studio is very good. if your teacher asked you to use Turbo C++ then use it if you don't care about being a good programmer in the future. i'm studying Communication engineering(however i don't like …

Member Avatar for mike_2000_17
-1
230
Member Avatar for joel_3
Member Avatar for Sarkurd
0
88
Member Avatar for david muchuku
Member Avatar for Sarkurd
0
170
Member Avatar for Moaid

Visit SFML, SDL or Allegro website. they have so many guides SFML is best choice for C++ programmers. good luck

Member Avatar for DeanMSands3
0
250
Member Avatar for Sarkurd

Hi what are Macros used for in C++? i never heard this word in my entire life :D and what are `assert()` and `NDEBUG`?

Member Avatar for Sarkurd
0
177
Member Avatar for Sarkurd

Hi i tried to test some new features of C++ 11 but how come Visual Studio doesn't support `constexpr`? i tried this simple function but it won't compile constexpr int multiply(int x, int y) { return x * y; }

Member Avatar for Sarkurd
0
1K
Member Avatar for daniela.valkanova

your function has only one parameter `maximum(T value)` change it to `maximum(T value1, T value2, T value3)`

Member Avatar for Sarkurd
0
6K
Member Avatar for Sarkurd

Hi i'm following a book but i don't understand `std::string::size_type` and some other data types specially `typedef` i see programmers use them too much. typedef int grades[5]; grades studenA[5], studentB[5]; and why just not use `int` instead of `size_type` while the result is same. #include <iostream> #include <string> #include <algorithm> …

Member Avatar for Sarkurd
0
761
Member Avatar for shahzrinsaid

i wrote the `CylinderVolume()` for you so you can have an idea to write the other function #include <iostream> using namespace std; const double pi= 3.14159; double CylinderVolume(double diameter, double height){ double radius = diameter/2.0; return pi * radius * radius * height; } int main(){ cin.ignore(); cin.get(); return 0; …

Member Avatar for <M/>
0
5K
Member Avatar for agrbinoo.albaker

you have some problems specialy in `getscore()` function and i don't see any advantage of line 32-45 since you're not using Array or Vectors you have to make a loop for each invalid score i hope this helps you a little #include <iostream> #include <iomanip> using namespace std; void getScore(int …

Member Avatar for Sarkurd
0
207
Member Avatar for Sarkurd

Hi after some months learing basics of C++, today i started by creating a simple game but i have problem two problems 1- `checkwin()` doesn't work properly 2- the code goes glitchy if i press Enter before choosing a block sorry for my english #include <iostream> using namespace std; char …

0
160
Member Avatar for phony

your code is so complicated i decided to write a new one here is a code i wrote for you so you can sort your file sorry if i didn't use a proper way i'm newbie too :D #include <iostream> #include <fstream> #include <string> #include <algorithm> using namespace std; int …

Member Avatar for nullptr
0
321
Member Avatar for Sarkurd

Hi i created a text file and put some numbers to it but when i read from it, the last number will be printed out twice #include <iostream> #include <fstream> #include <string> using namespace std; int main() { ofstream newfile("numbers.txt", ios::out); if (!newfile){ cout << "File not found" << endl; …

Member Avatar for Sarkurd
0
172
Member Avatar for l3the

I'm at the middle of learning C++ i'm following [Infinite Skills - Learning C++](http://www.infiniteskills.com/training/learning-c-plus-plus.html) it really helped me alot as a beginner

Member Avatar for Suzie999
0
380
Member Avatar for candyandy212
Re: c++

I'm agree with Suzie999 learncpp.com almost all the day open on my laptop

Member Avatar for Sarkurd
0
150
Member Avatar for Sarkurd

Hi i tried to do some training and write '==' operator to compare between two vectors but i got this error Error 1 error LNK2005: "bool __cdecl operator==(class vector,class vector)" (??8@YA_NVvector@@0@Z) already defined in Source.obj c:\Users\Sarbast\documents\visual studio 2013\Projects\Overloading Vector\Overloading Vector\Vector.obj Overloading Vector Vector.h #include <iostream> using namespace std; #ifndef VECTOR_H …

Member Avatar for Sarkurd
0
384
Member Avatar for Sarkurd

Hi i was following a tutorial but i stuck at something i don't understand it This is to find out how many times a number appeered inside an array sorry for my English #include <iostream> #include <conio.h> using namespace std; int main() { const int size = 5; int arr[size] …

Member Avatar for Sarkurd
0
309

The End.