Posts
 
Reputation
Joined
Last Seen
Ranked #72
Strength to Increase Rep
+15
Strength to Decrease Rep
-3
97% Quality Score
Upvotes Received
490
Posts with Upvotes
396
Upvoting Members
230
Downvotes Received
12
Posts with Downvotes
11
Downvoting Members
9
97 Commented Posts
13 Endorsements
Ranked #121
Ranked #60
~711.13K People Reached
Favorite Tags

1,288 Posted Topics

Member Avatar for existinglady

nodeType *head = NULL; ... p=head; p->link=newNode; head is NULL, so p is NULL, so p->link does not exist.

Member Avatar for Roy_264
0
6K
Member Avatar for Mahnoor_1

I don't see any code in the function readData that reads from the file edata.dat Start by writing a function that opens and reads data from edata.dat

Member Avatar for Muhammad_251
0
4K
Member Avatar for monkey_boy_401
Member Avatar for yobbko

libcurl is a popular library for fetching web pages. Alternatively, just use the wget programme as part of a script to fetch the data, and then your C++ programme to operate on it.

Member Avatar for baabroz1
0
429
Member Avatar for tensity

Wat is a card? It's an object that has a suit and a value from one to thirteen. So make a class named card that has two member variables; a value from one to thirteen (an int type springs to mind) and something to hold the suit value. Could be …

Member Avatar for Hunter_2
0
2K
Member Avatar for Sarlacc

If you're waiting for threads to finish, `join` comes to mind. http://en.cppreference.com/w/cpp/thread/thread/join

Member Avatar for Ben_27
0
7K
Member Avatar for montjoile

&*raiz means "give me the address of the contents of the thing the pointer raiz is pointing to"; '&' is an operator. It's a bit silly, as by definition raiz itself equals the address of the thing it is pointing to. Saying "give me the address of the contents of …

Member Avatar for Tushar_4
0
2K
Member Avatar for Anonymous_1

Where is the closing brace for the function `get_time_end`? Nowhere. That's where.

Member Avatar for Moschops
0
579
Member Avatar for mzee rajput

https://www.daniweb.com/software-development/cpp/threads/499448/artificial-inteligence-system

Member Avatar for bernardo.mclobo
0
137
Member Avatar for Affan Ahmed

`char q1[0]` This makes no sense. Why is it this? it should be `char q1` Same for the others. `char a[0]={"b"}` This makes no sense. Why is it this? It should be`char a='b'`. Same for the others. `int k+1 ;` This is just completely wrong. It doesn't make any sense …

Member Avatar for Moschops
0
247
Member Avatar for prgmmgbgnnr

If you want to store some kind of string, use a `string`. So those arrays of char arrays shouldn't exist. Just use an array of string. Or even better, a vector of string. `printf`? `scanf`? This is C++. Use `cout` and `cin`. What's going on with your headers? Are you …

Member Avatar for prgmmgbgnnr
0
238
Member Avatar for clife

If those shared libraries aren't build with debugging symbols and you don't have the source code, there is no way to see the source code. Are they built with debugging symbols and do you have the source code?

Member Avatar for rproffitt
0
319
Member Avatar for can-mohan

You're asking about a templated factory in C++. They start simple and go from there. Here's something to read: http://blog.fourthwoods.com/2011/06/04/factory-design-pattern-in-c/ If the only way you know what kind of object you want to create, though, is by reading a string, there's going to be no way around having to read …

Member Avatar for rubberman
0
264
Member Avatar for TheFearful

Your function `bruteforce`. I see that you set decrypt to be an empty string, so a string of size zero. You then start reading and writing to `decrypt[j]`. But decrypt is a string of length zero. Writing to the jth element of a string of length zero means you're writing …

Member Avatar for Moschops
0
456
Member Avatar for Anirudh_2

By "binary" I assume you mean a string in which each character is a one or a zero. Read in a char. Output four chars depending on what that input is, according to this table: http://www.learn44.com/wp-content/uploads/2011/08/Binary-to-Decimal-and-Hexadecimal-Conversion-Memorization-Chart.jpg So AA would be 10101010

Member Avatar for Moschops
0
223
Member Avatar for COKEDUDE

`if((int)strings_line_tokens[l][m] != 10 || (int)strings_line_tokens[l][m] != 0)` This says: `if (true)` There is no number in the universe for which this statement doesn't come out `true`. The first part comes out as true for everything that isn't 10. For the one case where the value you're testing *is* 10, the …

Member Avatar for Moschops
0
146
Member Avatar for SpottyBlue

`return naa, aL, S, aLot;` You can only return ONE value. Just ONE. As it happens, you're not even using the returned value. You need to learn about the following: returning values from functions passing by reference

Member Avatar for rubberman
0
198
Member Avatar for COKEDUDE

Neither of these are anything to do with "reading file error messages". `return` ends the function, and goes back to whatever called that function. The program continues running. `exit` finishes the program. Everything stops running, the program ends. They do different things. Neither is *better* that the other. They do …

Member Avatar for Moschops
0
229
Member Avatar for anumash

In C++, protection is at the class level. A member function of a class can access the private variables of *any* instance of that class.

Member Avatar for anumash
0
270
Member Avatar for mimic03

Is line 62 to 76 meant to be a function defintion? There's no opening `{` What's all that from line 81 supposed to be? Is that meant to be a function definition?

Member Avatar for Moschops
0
315
Member Avatar for Charite

`second = (P - int) * 60;` This makes no sense. What are you trying to subtract from the value `P`?

Member Avatar for Moschops
0
263
Member Avatar for jamesjohnson25

`buffer` is a char pointer, so `sizeof(buffer)` is the size of a `char*`, which is typically 4 or 8. If you passed in the number 8, then we would expect to see eight bytes written. One char takes up one byte, so we'd expect to see eight characters. How many …

Member Avatar for Moschops
0
139
Member Avatar for Toheed Rana
Member Avatar for rubberman
0
114
Member Avatar for can-mohan

When you call free, you must use a pointer with the same value as the one that was given to you by the corresponding malloc. Here is how to copy a pointer so that you can keep one with the same value. In this sample code, `pointer` is the pointer …

Member Avatar for can-mohan
0
1K
Member Avatar for anumash

> Does this mean C++ is inferior to other languages in its ability to truly implement data-hiding?? There's no such thing as a superior or inferior programming language; only the right tool for the job, given all the circumstances, and if you go around using words like that you'll annoy …

Member Avatar for ddanbe
0
280
Member Avatar for New Jack

What does it do that you think it shouldn't do, or what does it not do that you think it should do? You have to say more than "here is a problem". As an aside, you're including C headers for which there are modern C++ replacement version, and some of …

Member Avatar for Moschops
0
200
Member Avatar for vikash_5

Read a pair on integers? int a, b; scanf("%i %i", &a, &b); Easiest homework question ever. This thread can now be closed :)

Member Avatar for Moschops
0
75
Member Avatar for vikingGamer

Your number guess is wrong. You should be guessing a number from randRangeX to randRangeY. Instead, you're guessing from randRangeX to (randRangeX+randRangeY).

Member Avatar for Nutster
0
878
Member Avatar for lewashby

You have just reached the point where you are about to begin reinventing one of the standard tools of programmers; a Make tool. This, of course, is a good sign. I advise you very strongly at this point to take nobody's recommendation, including mine. Make tools are something that nobody …

Member Avatar for ipswitch
0
301
Member Avatar for Mariana_1

How much programming experience do you have, and with what languages? C++ is a low-level language; there are various definitions of what this means, but for the purposes of this conversation, it means that you have the flexibility and control to do an enormous amount with very few restrictions, but …

Member Avatar for ipswitch
0
386
Member Avatar for Mahnoor_1

> What if I write only cout instead of std::cout and all other streams? You already know the answer to this. Seriously, it's time to start thinking for yourself.

Member Avatar for ipswitch
0
372
Member Avatar for Dhana_1

This is not actually a programming question (or rather, to solve this by simulating the behaviour of the robot is a bad way to solve this). This is a simple maths question. Solve it on paper first.

Member Avatar for rproffitt
0
171
Member Avatar for juansgc
Member Avatar for juansgc
0
154
Member Avatar for can-mohan

Surely this is exactly what's expected. You create a unique pointer. You then construct another unique_ptr from that one, using the move constructor. So the original gets set to null. That's what happens when you move a unique_ptr. It's the whole point of a unique_ptr. Then you try to use …

Member Avatar for can-mohan
0
2K
Member Avatar for Jane Colleen

On line 23 you create a pointer. It is pointing at some random memory somewhere. On line 25, you pass a COPY of that pointer to the function initList ("pass by value" is the name for this - the function initList gets a copy of the parameter). This function uses …

Member Avatar for Moschops
0
248
Member Avatar for samuelneves

Do you have the libraries? They are files. They should be named libgd.so and libgd2.so If you do have the libraries, have you told Code::Blocks where those libraries are? http://www.learncpp.com/cpp-tutorial/a3-using-libraries-with-codeblocks/

Member Avatar for Moschops
0
219
Member Avatar for vicky sheikh

str and end are pointers. while (str is pointing at memory somewhere before what end is pointing at) { make a temporary copy of whatever str is pointing at copy whatever end is pointing at into what str is pointing at move the pointer str along one copy that temporary …

Member Avatar for Moschops
0
130
Member Avatar for jamesjohnson25

Also this: num1 is a pointer-to-an-int, so `*num1` is an int. num2 is a pointer-to-an-int. So `*num1 = num2;` has an int on the left, and a pointer-to-an-int on the right. It makes no sense. You're trying to assign a pointer (on the right) to an int (on the left).

Member Avatar for aleeha.saqib.5
0
225
Member Avatar for Mahnoor_1

`if(a.arr==a)` This appears to be an attempt to compare an array of five ints with a custom made class named array. This makes no sense. As an aside, do not name your custom class "array". That's a terrible name, because it will make people (including you) think of it as …

Member Avatar for aleeha.saqib.5
0
241
Member Avatar for nitin1

Every thread has a thread id. http://www.cplusplus.com/reference/thread/thread/id/ You could have a manager that keeps track of thread-singleton objects created for each thread; if a thread asks for one, and that thread_id already has one, give back the one already made.

Member Avatar for vijayan121
0
338
Member Avatar for Hector3000

You have written too much code that doesn't do what's needed working. Bin it. Start again, and take each requirement in turn. I can see that some parts of it you have no idea about; you're just guessing at code to write ( `int choice1, choice2, choice` is completely useless …

Member Avatar for Moschops
0
138
Member Avatar for usmanjani

C++ comes with a sort function. http://www.cplusplus.com/reference/algorithm/sort/

Member Avatar for usmanjani
0
254
Member Avatar for can-mohan

I haven't double-checked what I'm writing here, but it seems very familiar. In C++ implementations, class functions are shared. Every instance of a class uses the same functions. When you call the function, you're not going *through* any particular instance. You're calling the function, and the function is given a …

Member Avatar for Moschops
0
200
Member Avatar for nathan.pavlovsky

You're missing some braces. Each pair gets wrapped in braces. map<string, string> THE_SMS_CODES = {{".02", "Your (or my) two cents worth"}, {"10X", "Thanks"}}; Make sure your compiler is expecting C++11.

Member Avatar for nathan.pavlovsky
0
687
Member Avatar for Ali_50

This converts a string named input (which should be all ones and zeros) to a decimal integer. Remember to set your compiler to C++11 or later. `std::stoi` lives in <string> `int x = std::stoi(input, nullptr, 2);`

Member Avatar for Moschops
0
159
Member Avatar for shajin c l

You say it will remove the even numbers and zero fill, but it doesn't. At the start the array looks like this: `{1,2,3,4,5,6}` and at the end it looks like this: `{1,-1,3,-1,5,-1}` Even numbers not removed (but instead replaced with -1), array not zero-filled. The program does not do what …

Member Avatar for Moschops
0
4K
Member Avatar for can-mohan

The C++ FAQ (new style) talks about this. https://isocpp.org/wiki/faq/exceptions#ctors-can-throw

Member Avatar for can-mohan
0
393
Member Avatar for tinsaea

As an aside, when C++17 turns up, the filesystem library will allow something like this: `copy_file(source_path,destination_path);` Currently, you can make use of it through Boost.

Member Avatar for vijayan121
0
263
Member Avatar for smart2007

As a first draft brute force instrument, perhaps you're looking for the `usleep` function, to be found in the `unistd.h` header? http://unixhelp.ed.ac.uk/CGI/man-cgi?usleep+3

Member Avatar for Moschops
0
151
Member Avatar for hadisur_rahman

This function, `main`, is called by a different function. A function you don't know about, and you don't need to know about. That function, calling `main`, is expecting an `int` to be returned. So you return an `int`. When you understand how to code in C, and you understand what …

Member Avatar for sepp2k
0
281

The End.