Posts
 
Reputation
Joined
Last Seen
Ranked #103
Strength to Increase Rep
+15
Strength to Decrease Rep
-3
95% Quality Score
Upvotes Received
399
Posts with Upvotes
343
Upvoting Members
225
Downvotes Received
17
Posts with Downvotes
16
Downvoting Members
15
92 Commented Posts
~985.17K People Reached
About Me

I'm 29 and currently learning c++. I like doing mathematical computations and working on encryption methods. Now I am currently learning how to use Whittmann Robots.

Interests
C++, math, football (American), music (not country), playing with my god kids
PC Specs
Intel i5-2500k 3.3 Ghz processor, 16 GB DDR3 1600 ram, 1 GB Video PCIx2.0 x16, 2TB HD, running Windows…

1,426 Posted Topics

Member Avatar for rajesanthu

@takuya17 - Please don't resurrect dead threads with something completely unrelated. If you want to contract a coding job you need to do so under the Jobs and resumes section in business exchange.

Member Avatar for Youssef Faisal
-4
44K
Member Avatar for rodeostar04
Member Avatar for N@sir
0
5K
Member Avatar for ellaine101591

in your if statement when you are outputting your picture of the hanging man you are using a \. with c++ that is an escape character and is used for special purposes line \n for newline. in order to output a single \ to the screen you would need [icode] …

Member Avatar for MUGDHA_2
0
3K
Member Avatar for casey.li.146

Can you paste about 10 lines or so from the file into here. Does every column value have a "," after it or does each line end with a newline? Generally with a CSV file if there is an empty column it is represented as ",," but I don't see …

Member Avatar for ming_1
0
6K
Member Avatar for Kaushalya15
Member Avatar for Aild

Right off the bat from your code you need to put `int GetanInt();` before your main function so that the compiler knows there is a function called GetanInt() somewhere. Secondly you have a semi colon after your function name on line 17. There could be more but thats right from …

Member Avatar for Andy_20
0
13K
Member Avatar for Bob

using standard code you could do the following char choice; do { // your code goes here std::cout << "Do you want to go again (y/n): "; std::cin.get(choice); } while (::tolower(choice) == 'y');

Member Avatar for JamesCherrill
3
53K
Member Avatar for Sarlacc

You might be able to use a [`std::mutex`](http://en.cppreference.com/w/cpp/thread/mutex) for this. You might also want to rethink your data structure. You could have all of the thread writing to a [thread safe queue](https://www.justsoftwaresolutions.co.uk/threading/implementing-a-thread-safe-queue-using-condition-variables.html) and the reader could be processing it at the same time. This might make your execution faster.

Member Avatar for Ben_27
0
7K
Member Avatar for daino

What you have right now is a sigle letter. If you want to use a c-style string you need to define wrd like `char wrd[80]` where 80 is the number of charactures max that it can hold. You can change 80 to be what every you want but you want …

Member Avatar for deceptikon
0
43K
Member Avatar for naik.pranjal

Okay. What do you have so far? Do you know how to use for loops? Do you know how to use a char vareiable?

Member Avatar for Varun_8
-1
880
Member Avatar for k3rry41o

Well if we use integer math then the answer would be #include <iostream> int main() { std::cout << 1; std::cin.get(); return 0; }

Member Avatar for ddanbe
-2
106
Member Avatar for surayanbo
Re: Cpp

http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list

Member Avatar for NathanOliver
0
109
Member Avatar for Sara_13

For three integers you can hardcode it fairly simply as int a, b, c; std::cin >> a >> b >> c; int positiveCounter = 0; int negativeCounter = 0; if (a < 0) negativeCounter++; else positiveCounter++; if (b < 0) negativeCounter++; else positiveCounter++; if (c < 0) negativeCounter++; else positiveCounter++; …

Member Avatar for David W
0
289
Member Avatar for anumash

Derived classes only need to construct the classes the directly derive from. If those classes derive from something else then it the responsibility of those classes to construct what classes the directly derive from. Take the follwing example class Foo {}; class Bar : public Foo { public: Bar() : …

Member Avatar for NathanOliver
0
176
Member Avatar for anumash

Memeber functions are members of a class. Because of that they are not the same as free functions when it comes to function pointers. void (*ptr)(void); Will match any function that returns void at takes no parameters that is not a memeber function. void (A::*ptr)(void) Will match any function that …

Member Avatar for anumash
0
257
Member Avatar for herge

What is your question? 26,760,055 bytes is only 26.7 MB which is not very large in todays world.

Member Avatar for NathanOliver
0
146
Member Avatar for anumash

As [Bjarne Stroustrup](https://en.wikipedia.org/wiki/Bjarne_Stroustrup) has said >**C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg.**

Member Avatar for ddanbe
0
280
Member Avatar for New Jack

The first issue is your comparison operator is not folowing the strict weak ordering that `std::set` requires. You are only comparing `L` when you need to check if the `L`'s are equal and if they are then comapre against `r`. bool operator<(const _point &a)const { if (L == a.L) return …

Member Avatar for Moschops
0
200
Member Avatar for Gudger

Um 1, 4, 6, 12, 15, 20, 30 and 60 are not prime factors. the prime factors of 60 are 2, 2, 3, 5. You can prove that since `2*2 = 4` and `4 * 3 = 12` and `12 * 5 = 60`

Member Avatar for New Jack
0
291
Member Avatar for Farhan_4

Why are you looking for spaces in a csv file? csv stands for comma seperated values. Your file should look like 1.1,1.2,1.3 2.1,2.2,2.3 ...

Member Avatar for mellertson
0
19K
Member Avatar for you207

You could do this fairly easily with a `stringstream` and `getline()`. The split function would look like: std::vector<std::string> split_string(const std::string & line, char delim = ' ') { std::vector<std::string> sep; std::string token; std::stringstream ss(line); while(getline(ss, token, delim)) sep.push_back(token); return sep; } And then you could use it like int main …

Member Avatar for David W
0
563
Member Avatar for ddanbe

I will have to agree with @Suzie999 on this. Once you get into the mindset of using `const` whenever you have a constant value then you should just keep on using it. Not only does it keep the that behavior front an center but it is someting you should always …

Member Avatar for ipswitch
0
442
Member Avatar for nathan.pavlovsky

More than likely one of the headers that you are including in your code is including that header. This is something you should **NOT** rely on. You should explicitly include all headers needed to compile your code and not rely on something else including it for you. A different compiler …

Member Avatar for nathan.pavlovsky
0
263
Member Avatar for Aabir

You are not allowed to define a function in a function and that is what the compiler is complaining about. There are two solutions to this. You could move the function out of main and put it in the global scope or you can change the function into a [lambda](http://en.cppreference.com/w/cpp/language/lambda) …

Member Avatar for NathanOliver
0
511
Member Avatar for nathan.pavlovsky

@nullptr you should really be using a unsigned char as any other value is UB. http://en.cppreference.com/w/cpp/string/byte/tolower

Member Avatar for nathan.pavlovsky
0
738
Member Avatar for Suzie999

reading the answer [here](http://stackoverflow.com/questions/696117/what-happens-when-you-close-a-c-console-application) it looks like you can register an event handler with the OS and handle the closing of the cmd window youself. in the closing routine you could cleanly close out the API so it usable the next time.

Member Avatar for gusano79
0
272
Member Avatar for Mariana_1

And the reason you posted this again instead of using the wonderful advice Moschops gave you? If you need to follow up with you question please use: https://www.daniweb.com/software-development/cpp/threads/498358/game-on-c-

Member Avatar for NathanOliver
0
220
Member Avatar for can-mohan

As Moschops said you are moving the data from `p` so trying to use it after that results in your segfault. `std::unique_ptr` doe have an `operator bool()` that will return `true` if `get() != nullptr`. Using that we can protect against using the pointer if it no longer manages a …

Member Avatar for can-mohan
0
2K
Member Avatar for segadude

Silly question but can't you have your teacher explain what you should have done not to have points taken off? It is hard for us to know what he is thinking.

Member Avatar for NathanOliver
0
207
Member Avatar for jamesjohnson25
Member Avatar for Ahmed91za

No one is going to write the code for you. If write some code youself and you have an issue with it then post the code you have and what the issue is. also include any sample data and expected output. See http://sscce.org for more on writing a good code …

Member Avatar for ravenous
0
297
Member Avatar for kumanutiw

If you [indent](https://en.wikipedia.org/wiki/Indent_style#Allman_style) you code correctly we might be able to help you better.

Member Avatar for NathanOliver
0
187
Member Avatar for Xia_1

No one is going to write the code for you. If write some code youself and you have an issue with it then post the code you have and what the issue is. also include any sample data and expected output. See http://sscce.org for more on writing a good code …

Member Avatar for NathanOliver
0
236
Member Avatar for Hector3000

You cannot use a `switch` `case` with a `std::string`. `switch` can only evaluate integer type expressions. See this for more information on `switch`: http://en.cppreference.com/w/cpp/language/switch

Member Avatar for vijayan121
0
192
Member Avatar for usmanjani

Don't. `graphics.h` comes from the old wild west days of C++ and is not portable/standard.

Member Avatar for Schol-R-LEA
-1
245
Member Avatar for abcdz
Member Avatar for kumanutiw
Member Avatar for usmanjani
Member Avatar for usmanjani
0
254
Member Avatar for tgreiner

If you have an unknow amount of data to read then you can read in each object/line from the file and store it into a vector. Lets say you have a file containing only integer data. You coud read that with: std::vector<int> data; std::ifstream fin("name_of_file.txt"); if(!fin) std::cout << "unable to …

Member Avatar for David W
0
485
Member Avatar for Alan_7
Member Avatar for Utopia_1

We will not do your homework for you. If you have a problem with the code you have then post the code and what the problem is.

Member Avatar for David W
-3
174
Member Avatar for Mahnoor_1

Lines 8-12 will never be executed with the code you have. In your function you have: if(b<=4) return b; else return go(b+1)*go(b-2)-(b*2); So if `b <= 4` then you `return b;`. is be is anything else then you `return go(b+1)*go(b-2)-(b*2);`. Anything after the `if` will never be executed as both …

Member Avatar for Mahnoor_1
0
174
Member Avatar for adnan_6

I doubt anyone is going to do that for free for you. There is a [Jobs and Resumes](https://www.daniweb.com/business-exchange/jobs-and-resumes/52) forum where you could post this as a contract job and pay someone to do it for you.

Member Avatar for adnan_6
-1
208
Member Avatar for rythreion

@Zoran_1 Your code is not C++. This is a question is asking about solving this with C++.

Member Avatar for NathanOliver
0
4K
Member Avatar for nathan.pavlovsky

Doing most things with standard containers involves using iterators. Even using the new ranged based for loops does. If you take for example: for ( range_declaration : range_expression ) loop_statement This becomes: { auto && __range = range_expression ; for (auto __begin = begin_expr, __end = end_expr; __begin != __end; …

Member Avatar for NathanOliver
0
228
Member Avatar for Kasxar

Sure. There are plenty of good book [here](https://www.daniweb.com/software-development/cpp/threads/70096/c-books) and [here](http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list) you could use.

Member Avatar for vegaseat
0
131
Member Avatar for masaker

No we will not give you the code for you assignment. This is called cheating and in any decent educational institution you should get expelled for that. Now if you work on your own code and you run into a problem with it then you can post that problem here …

Member Avatar for David W
0
2K
Member Avatar for Simon180

It should be possible. It depends on how platform dependent the code bases are and how standard compliant the code is.

Member Avatar for Simon180
0
232
Member Avatar for leonardo123

@basit_3 please refrain from just giving code to homework vultures. If they have a problem with code helping them is fine. Just give me the code questions should be ignored.

Member Avatar for mridul.ahuja
-3
153
Member Avatar for ashhad kamal

1) Open program to write code 2) Write code 3) Compile code 4) If you have compiler errors fix them and go to step 3 else continue 5) Run code and make sure you get what you want else go to step 2

Member Avatar for NathanOliver
0
224

The End.