Last Seen
Ranked #103
Strength to Increase Rep
Strength to Decrease Rep
95% Quality Score
Upvotes Received
Posts with Upvotes
Upvoting Members
Downvotes Received
Posts with Downvotes
Downvoting Members
92 Commented Posts
~966.01K 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.

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…
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
Member Avatar for rodeostar04
Member Avatar for N@sir
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
Member Avatar for

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
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
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
Member Avatar for Sarlacc

You might be able to use a [`std::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]( and the reader could be processing it at the same time. This might make your execution faster.

Member Avatar for Ben_27
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
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
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
Member Avatar for surayanbo
Re: Cpp

Member Avatar for NathanOliver
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
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
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
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
Member Avatar for anumash

As [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
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
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
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
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
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
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
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]( …

Member Avatar for NathanOliver
Member Avatar for nathan.pavlovsky

@nullptr you should really be using a unsigned char as any other value is UB.

Member Avatar for nathan.pavlovsky
Member Avatar for Suzie999

reading the answer [here]( 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
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:

Member Avatar for NathanOliver
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
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
Member Avatar for jamesjohnson25