1,288 Posted Topics

Member Avatar for cambalinho

Not quite. `CMyAxUICtrl` is the name of a class. To use this function, you would have to create an object of the class type first: `CMyAxUICtrl beansOnToast;` and then use the function in that object `beansOnToast.OnDraw(param1, param2, param3);` If I had to guess, I'd say that OnDraw is probably called …

Member Avatar for cambalinho
0
290
Member Avatar for Learner010

First you create an `int`, named `v`, and give it the value of 10. Then, you create an unnamed pointer to v, like this: `&v`. You pass that unnamed pointer to the function named `afunction`, which gets a copy of that unnamed pointer. Inside `afunction`, you give that copy of …

Member Avatar for StuXYZ
0
151
Member Avatar for mxwarning
Member Avatar for arashe
Member Avatar for sana.f.qureshi_1

`len=strlen(input);` `input` is a char. A single char. The function `strlen` takes a char\* parameter. You cannot use a char instead of a char pointer. Did you really mean to read just a single character from the input file?

Member Avatar for VertexF3
0
1K
Member Avatar for nekoleon64

There doesn't seem to be a `main` function in this program. I'll guess that you do actually have `int main()` before line one, above. When I run it, it does this: 0.00 16.96 23.78 9.85 18.34 Do you not get anything out? Your code has one problem; when you start …

Member Avatar for iamthwee
0
374
Member Avatar for phony

` class PString :: public string` ONE colon here for inheritance. `void bool isPalandrome();` Does it return void, or bool? Pick one, and also fix the spelling; later, you name this function isPal**i**ndrome. ` lower++` Missing semi-colon `class PString::isPalindrome(bool)` The first word here should be what kind of object this …

Member Avatar for phony
0
760
Member Avatar for nitish.mohiputlall

Some of this makes no sense. You've got a queue of strings, so what's that array for? When you delete a name from the queue, you're showing the user somethig from the array? Why? Get rid of the array and just work with the queue.

Member Avatar for Moschops
0
139
Member Avatar for Jephthah_1

http://en.wikibooks.org/wiki/C_Programming/Simple_input_and_output

Member Avatar for rubberman
0
77
Member Avatar for moaz.amin.37

Look at each char in the input string. If any of them are digits (`isdigit`), disallow.

Member Avatar for Ancient Dragon
0
130
Member Avatar for mohanned_1

Are you trying to use iostream or iostream.h? Show us the code that doesn't work.

Member Avatar for Ancient Dragon
0
287
Member Avatar for Stefan_2
Member Avatar for agrbinoo.albaker

I expect it can't find the file. Is the file in the same directory that your program is running in? This is often not the same thing as the directory your source code is in. Test that the file is found correctly. ifstream filestr; filestr.open ("test.txt"); if (filestr.is_open()) { filestr …

Member Avatar for Moschops
0
176
Member Avatar for phony

When you do this `Dynque<string> queue;` your constructor calls this `clear();` which then calls this `dequeue(value);` which then tries to do this `val = front ->value;` but front is pointing at some random memory somewhere that doesn't belong to you, so you get a segFault (the OS won't let you …

Member Avatar for phony
0
301
Member Avatar for trantran

template <typename DATA> struct node{ node <DATA> * left; node <DATA> * right; DATA data; }; That makes no sense. A node needs to point to another node, not to a DATA.

Member Avatar for trantran
0
822
Member Avatar for catastrophe2

You've only got one list. You need to have TWO lists, and copy the data from one to the other.

Member Avatar for catastrophe2
0
302
Member Avatar for lewashby
Re: qt

The file named `QApplication`. Your compiler can't find it. First check that you did install the QT libraries, and check where that header file was installed to. When you find it, ensure it's on your standard g++ include path. If it isn't, you'll need to add it to the g++ …

Member Avatar for JasonHippy
0
148
Member Avatar for vishalonne
Member Avatar for Learner010
0
231
Member Avatar for smitsky

Which lines again? We see the line numbers HERE, on the forum. Do yourself a favour by doing US a favour and make sure the line numbers you quote are the line numbers we see. Have you investigated this? Perhaps your function calculate could output the value of each variable …

Member Avatar for smitsky
0
200
Member Avatar for admiri92
Member Avatar for Aditya_8

C++ programs begin at the function called `main`. You don't have a function called `main`, so you can't make this into a program. Are you trying to make a program or a library?

Member Avatar for Ancient Dragon
0
167
Member Avatar for mR-_-EBoOo

This being C++, we prefer cstdio. #include <cstdio> int main() { char c; std::scanf("%c", &c); std::printf("You typed %c", c); } As I recall, the C++ standard promises the functions will be in the std namespace, and they may also be in the global namespace.

Member Avatar for rubberman
0
128
Member Avatar for ferizhandi
Member Avatar for naveen1993
0
249
Member Avatar for can-mohan

You can only use `delete` on a pointer if the memory it points to was allocated by `new`.

Member Avatar for can-mohan
0
446
Member Avatar for moaz.amin.37

This is a terrible use for a static data member. That said, someone gave you code already in the other thread.

Member Avatar for Kristian_2
0
890
Member Avatar for Hector_2

> I can't get the code to display in an ordered list. In that screenshot, at the bottom, it is sorted. What don't you like about it?

Member Avatar for Hector_2
0
196
Member Avatar for evaxhoxha

How far have you got? Are you having trouble with the thinking (ie. coming up with the solution in a series of programmable steps) or are you having trouble with writing the code for your solution?

Member Avatar for evaxhoxha
0
113
Member Avatar for kamalashraf

` other=&List;` This line makes no sense. `system("pause");` system lives in the cstdlib header. `void ListIterator<T>::setData(const T value){list.setdata(current,value); current++;}` setdata does not exist, but setData does. `ListIterator(const List<T> &l): list(l), current(0) { }` Drop the const.

Member Avatar for Ancient Dragon
0
155
Member Avatar for moaz.amin.37

In this case, when you do this: `if(str=="hello") ` on the left you have a `pointer`, and on the right you have a `pointer`. The value of a pointer is the number it holds; a single memory address. So the value on the left would be something like 0x0324FEED (a …

Member Avatar for Ancient Dragon
0
324
Member Avatar for daniel1977

You're trying to pass the function an int (i) and a pointer-to-extPersonType. It doesn't want a pointer. It wants the actual object. Don't give it a pointer-to-extPersonType. Give it an actual extPersonType (or change the function so it takes a pointer).

Member Avatar for Moschops
0
436
Member Avatar for Emma_3

> Ideas? As Rubberman says, if you want it to output something, you'll have to write some code for that. It won't do it by magic. I see you already know how to use `cout`; that'll do fine.

Member Avatar for Moschops
0
283
Member Avatar for kal_crazy

> How do I show spelling mistakes on the console? Should I highlight the text that has the spelling mistake? Up to you. If you want to manipulate the console in that way, you're going to have to read up on how your console works (which is heavily system dependent …

Member Avatar for Moschops
0
223
Member Avatar for agrbinoo.albaker

This is almost trivial. You wasted more time asking than just doing it. http://www.cplusplus.com/doc/tutorial/basic_io/

Member Avatar for jwenting
0
181
Member Avatar for Labdabeta

C++11 comes with a `shared_pointer` template that could be used here, I think. You'd need to create the `shared_pointer` with a custom deleter parameter so that `delete[]` is called rather than `delete`. You return the shared_pointer, and when it falls out of scope at the caller, the array is deleted.

Member Avatar for mike_2000_17
0
551
Member Avatar for Complete_1
Member Avatar for vinay L
Member Avatar for daniel1977

You're trying to use the `+` operator with objects of type `RomanType`, here: `Rom3 = Rom1 + Rom2;` but the code for that operator is commented out. For starters, uncomment it. You've got code for that operator on the `extRomanType`, but your code doesn't ever use objects of that type. …

Member Avatar for Moschops
0
298
Member Avatar for dennis.ritchie

I got turned down for a job once for giving that as a way to swap two values without using a temp value. Too much of a liking for "elegant cleverness", apparently.

Member Avatar for Kristian_2
0
231
Member Avatar for infamous1987

Two pigs in a barn: [CODE]#include <iostream> int main() { using std::cout; cout << "Eggs eat stonks" int a = 65; int b = a/3; }[/CODE] Wait, what are the rules of this game again?

Member Avatar for Kristian_2
0
169
Member Avatar for jhender4880

What makes you think the second array isn't one bigger? Maybe if you displayed all six elements in the second array, instead of just five, you'd be able to tell if it worked.

Member Avatar for jhender4880
0
222
Member Avatar for ckide
Member Avatar for invadev
0
310
Member Avatar for smitsky

The short answer is no. If you need to examine all elements of the container without removing them, a queue is not what you need. Consider a deque instead.

Member Avatar for smitsky
0
221
Member Avatar for gu mi nam

`BST*binary_search_tree;` This is an attempt to multiply BST by binary_search_tree. Did you mean that?

Member Avatar for gu mi nam
0
399
Member Avatar for <iostream>

Do it one piece at a time. Start with this: Write a C++ program that would display the menu of a restaurant

Member Avatar for rubberman
0
134
Member Avatar for alagez

What's a manufacturing problem? QT presents a broad range of examples: http://qt-project.org/doc/qt-5/qtexamplesandtutorials.html

Member Avatar for Moschops
0
71
Member Avatar for Labdabeta

I saw something similar once; a value was being cached locally, and then the memory storing it was being trashed. Because the value had been cached, it didn't matter that the memory had been trashed - the cached version was used. Inserting another variable meant that the cache was being …

Member Avatar for Labdabeta
0
197
Member Avatar for ravi_14

When you `#include iostream`, you get the object `std::cout` That is, you get the object `cout`, which is in the std namespace. You can use an object in the std namespace either directly: `std::cout << "Something";` or by stating that you want to use that particular object like this: using …

Member Avatar for vmanes
0
533
Member Avatar for butterfingerss

"QT" is just the name given to a set of libraries and related. The OP is not coding in "QT"; they are coding in C++. I suspect that the OP has downloaded QT Creator and thinks that QT is some kind of separate programming language. It is not. You're coding …

Member Avatar for Moschops
0
2K
Member Avatar for butterfingerss

When you store each character in the file, change in first. When you read each character back from the file, do the reverse change.

Member Avatar for sarahwilliams25
0
1K
Member Avatar for butterfingerss

Off the top of my head, create a vector<string> object, store every line as a string in the vector, add the strings A, B, C ... Z, use the standard algorithm sort function on the vector, and you've got a sorted vector<string> with A, B, C ... Z as you …

Member Avatar for David W
0
215

The End.