1,288 Posted Topics

Member Avatar for kamalashraf

> after taking book name to a temp veriable, how can i pass it to setboob() member function `setboob(temp_variable);`

Member Avatar for Moschops
0
140
Member Avatar for Seba Sama
Member Avatar for Seba Sama
0
225
Member Avatar for user4678

See that part of your code where you add the next term? Add the next term IF the next term is greater than 0.0001

Member Avatar for duskoKoscica
0
6K
Member Avatar for emorjon2

Just to add to Mike's words on memory leaks, you're running this on a Windows machine, but if you were running on a \*nix, you could use valgrind to identify your memory leaks for you; granted, it's pretty easy in this case (a bazillion `new`, no `delete` - memory leak …

Member Avatar for mike_2000_17
0
568
Member Avatar for mixelplik

Your code generates three different random numbers. One to compare to 50, one to compare to 100, and one to put in the array. Try this: for(int i = 0; i < 40; i++) { a[i] = rand()%(max-min + 1) + min; } where max and min are, in your …

Member Avatar for Moschops
0
661
Member Avatar for pangandagf

Do you know how to get one character from a string? http://www.cplusplus.com/reference/string/string/operator[]/

Member Avatar for richieking
0
100
Member Avatar for sehrish20
Member Avatar for gerta_1
Member Avatar for duskoKoscica
0
541
Member Avatar for mike_2000_17

Given that the code uses the C++ standard library and c++ only features such as templates, I rather suspect that this is making use of the g++ extension that allows VLAs in C++. It certainly won't compile as C :)

Member Avatar for Tumlee
4
684
Member Avatar for johnson_2

If it's a single C++ file, can you simply create a new project in netbeans and copy the code across? This would be an excellent opportunity for you to learn how creatign a C++ program actually works, so that in future you'd be able to move your code around any …

Member Avatar for Moschops
0
154
Member Avatar for ali hassan q

Add up all the hours, multiply by three, divide by the number of students.

Member Avatar for Moschops
0
403
Member Avatar for Adeel Rahat
Member Avatar for learncoding

You could do worse than debugging it yourself. Something like this comes to mind: bool operator==(const person &lhs, const person &rhs) { cout << "Comparing lhs.name " << lhs.name << " to rhs.name " << rhs.name << endl; return lhs.name == rhs.name; }

Member Avatar for Paul.Esson
0
566
Member Avatar for Denral

In what way is cout not working? Does the code compile? Do you get an error message? What do you see on screen? Does it run? Does the window it runs in close too fast for you to actually see what happens? Dev C++ 4.9.9.2 is a terrible choice. Throw …

Member Avatar for blueshiftdani
0
186
Member Avatar for yann.bohbot.9

Here is how to check if a pointer is not NULL before using it: if (pointer != NULL) { // do something with the pointer } else { // don't do something with the pointer }

Member Avatar for yann.bohbot.9
0
146
Member Avatar for nadiam

Try lines 58 and 61 with an extra space in them, like this. 58: `scanf(" %[^\n]s",&newptr->item_name);` 61: `scanf(" %[^\n]s",&newptr->item_code);` Or even better, without the bad argument type, 58: `scanf(" %[^\n]s",newptr->item_name);` 61: `scanf(" %[^\n]s",newptr->item_code);`

Member Avatar for nadiam
0
276
Member Avatar for roidbeginner

You are using one variable, `output`, to store the decrypted password. However, you are just adding each decrypted password onto the end of the last one in your variable `output`. This is bad. Each time you're finished checking a password, reset `output` to blank.

Member Avatar for roidbeginner
0
1K
Member Avatar for naji.awad1

There is no best game tutorial. That's an impossible demand. What do you want to do? Give us something specific that you don't know how to do right now that you want to do. Show an image? Show a 3D shape? Make a sound? Make a shape move on the …

Member Avatar for Ancient Dragon
0
228
Member Avatar for mixelplik
Member Avatar for mixelplik
0
266
Member Avatar for SurafielHabib

This code shows a function `uniformSearch` that will search an array and will take a uniform amount of time, except if the array is really, really big. If that happens, you can increase the amount of time the search should take until it takes a uniform amount of time again. …

Member Avatar for Moschops
0
4K
Member Avatar for pem

Line 15. The vector `v` has no contents. It is of size zero. `max_element` returns the iterator that is `v.end()`. You then try to dereference this iterator, which is forbidden.

Member Avatar for Moschops
0
122
Member Avatar for triumphost
Member Avatar for James19142

Are you sure it doesn't run? That output seems to indicate that it did run, and it finished with a return value of -1.

Member Avatar for James19142
0
1K
Member Avatar for viovicente

Have you tried checking the value of the variable to see if it changes? That's a complete guess, but since you haven't actually asked any question, I've got very little to work with. http://www.daniweb.com/software-development/cpp/threads/78223/read-this-before-posting-a-question

Member Avatar for Moschops
0
70
Member Avatar for yann.bohbot.9

The standard C library function `strstr` can be used to search a string for a substring.

Member Avatar for yann.bohbot.9
0
235
Member Avatar for Builder_1

As deceptikon says, they're different headers giving you different things. <string> gives you these capabilities: http://en.cppreference.com/w/cpp/header/string <cstring> gives you these: http://en.cppreference.com/w/cpp/header/cstring

Member Avatar for Builder_1
0
7K
Member Avatar for sam7777777

How far have you got? I note that you say you have to use doubly linked lists, but the assignment says singly linked lists. Which is it? Have you written down the actual things you need to do (i.e. do you understand the assignment)?

Member Avatar for Moschops
0
950
Member Avatar for tiverton

> cout,cin,endl are no longer supported Really? I suspect that actually, your code is wrong. Alternatively, you've not told it you're trying to code in plain C++ (Visual Studio supports many languages). Possibly you're learning C++ from before 1990 and you're not using namespaces. Let's see your code.

Member Avatar for tiverton
0
264
Member Avatar for sadia.rasheed.9231

Do you need to do this using C++? This kind of thing is easily done with standard command line tools. For example, on many \*nix systems, `grep -c word_to_find name_of_file` does this quickly and efficiently.

Member Avatar for Moschops
0
339
Member Avatar for Smartboy33

C++ doesn't have any built in graphics. There are moves afoot, heavily driven by Herb Sutter, to add graphics to a future C++ standard (C++ 17, perhaps). If you want to show somethig on screen, ultimately you ask the operating system to ask the graphics driver to do it for …

Member Avatar for Moschops
0
546
Member Avatar for anar.bataa

What OS are you using? While there are many ways to do this using C++, the ubiquitous command line tool "grep" is literally made for this.

Member Avatar for rubberman
0
213
Member Avatar for kent.johnstone_1

If `Voltage_High` is of type float, then `&Voltage_High` is of type pointer-to-float. The fact that all pointers are the same size in memory is irrelevant. If you want to point to a float, you need a float-pointer; `float* pVoltage = &Voltage_High;`

Member Avatar for kent.johnstone_1
0
423
Member Avatar for intelharsh

Are you struggling to come up with the algorithm to identify a semi-circle, given a set of contours, or do you have your algorithm and you're struggling to code it?

Member Avatar for Moschops
0
864
Member Avatar for kent.johnstone_1

`pointerToSomeObject->aMemberFunctionOfThatObject` is the same as `*(pointerToSomeObject).aMemberFunctionOfThatObject` `->` is just shorthand for "dereference this pointer, and then give me this member function/variable.

Member Avatar for kent.johnstone_1
1
246
Member Avatar for yogesh_6

Please help us to help you. What input do you give it, what output do you get,and how is that different from what you want? Is this intended to be a bubble sort implementation?

Member Avatar for Moschops
0
150
Member Avatar for princessophia

When you run a program, it has what is knwon as a "working directory". This is the place you can effectively think of the program, as the name implies, working in. This is where it will look for files to open, by default. This is where it will write files …

Member Avatar for ling_tj
0
329
Member Avatar for MacErich

To debug this, build with debug symbols, set your debugger to watch the variable you are interested in, and when the variable is changed the debugger will interrupt the program and you can see what changed the variable.

Member Avatar for MacErich
0
198
Member Avatar for mythos061

You do sound confused. If I point out to you that in C++, a struct and a class are identical except for default privacy levels, does that help? > But technically I want to use a struct as the template arugment, not a class. There's no difference.

Member Avatar for mythos061
0
204
Member Avatar for khelkely

Your code never inserts a patient record. Your insert function never gets to line 146 because on line 138 you call menu().

Member Avatar for Moschops
0
176
Member Avatar for sohail.butt.144
Member Avatar for mixelplik

The condition is checked at the start of the while loop. Then the contents of the while loop are executed. All of them. Changing the value of that condition during the loop has no effect until the condition is checked. When is the condition checked? At the start of the …

Member Avatar for mike_2000_17
0
149
Member Avatar for DanJones

`checkLength(length) == false || lowerCase(length, line) == false || upperCase(length, line) == false || beginLetter(length, line) == false || correctDigits(length, line) == false || specialChar(length, line)` When this is executed, from left to right, as soon as the final outcome is known for sure, all the rest will be skipped. …

Member Avatar for DanJones
0
435
Member Avatar for psc1436

Ah yes, the perenial Ponzi scam. This forum is about a different kind of programming :p

Member Avatar for psc1436
0
126
Member Avatar for salah_saleh

You're monitoring the default constructor, which is being used once. You're not monitoring the copy constructor as well. Add this to your class to see it: A( const A& other ) { cout<<"A copied"<<endl; }

Member Avatar for salah_saleh
0
132
Member Avatar for Is_at_work

Your writefile function is fine. What makes you think it isn't working? It will create the file "results.txt" in the working directory. Have you looked in the working directory? This will (if you're using an IDE) probably not be the same directory that the source code is in. If you …

Member Avatar for kal_crazy
0
175
Member Avatar for SpottyBlue

`char *name[x];` This creates an array of char pointers. Each one is pointing to some random place in memory. `infile >> name[i];` This is an attempt to write over than random place in memory. Writing over some random place in memory is very very bad. If you make a pointer, …

Member Avatar for Moschops
0
410
Member Avatar for Rohan_1

> Can u plz help why dis happens? You've spelt "you", "please" and "this" incorrectly. Many people here speak English as a second language and deliberately misspelling words while asking for help won't encourage people to help you. So your code goes through the if statement, and then the goto …

Member Avatar for Ancient Dragon
0
204
Member Avatar for Ms.toumi

Start at the beginning. > Write a program that prompts the user to input two positive integers Can you do this?

Member Avatar for ObSys
0
154
Member Avatar for jackslv

**ex233(0 or less)** *does nothing.* **ex233(1)** outputs 1, calls ex233(-1), calls ex233(0), outputs 1. We already know about ex233(-1) and ex233(0), so this can be summarised as *outputs 1, outputs 1* **ex233(2)** outputs 2, calls ex233(0), calls ex233(1), outputs 2. **ex233(3)** outputs 3, calls ex233(1), calls ex233(2), outputs 3. Now …

Member Avatar for jackslv
0
235
Member Avatar for Qutbuddin

A header file is a text file. Just plain text. If you have a text file that you want to use as a header file, make sure it's correct C++ code, name it something.h, and then put it somewhere sensible, like next to your cpp files or in a separate …

Member Avatar for mike_2000_17
0
4K

The End.