49,756 Topics
![]() | |
Hi, I am new to stacks and need some help getting started with my first program in stacks. I have all the functions like pop,push etc. in my header file. I have to create a palindrome program with the objectives below. If someone can give me an idea on how … | |
How to prompt user enter 10 integer then sort it in both ascending and descending order and also ask user either they want to sort it by insertion sort or selection sort or bubble sort?? | |
Hey guys, Can anyone post sample code about updating an object that is already in an std::list? I know that it sounds as a really stupid question, but obviously I'm doing something wrong. In my code I'm going through the list with an iterator until I reach the object of … | |
This is just part of my code. For some unknown reason, the value of staff is correct after using copy constructor, however, once it goes out of the loop, 2 of s value's turn into -858993460, other values stay fine, look at the red lines part of the code [CODE] … | |
so im trying to practice writing a few programs that might have to do with my upcoming test soon. in this program i wanted the user to enter a test score and it couts the letter grade. doesnt work properly it couts the test score instead of the letter grade. … | |
I started a new thread since my last thread was getting to long. I am using stacks to find out if a string of characters is a palindrome, is not a palindrome, and is almost a palindrome. However, my output comes up and then disappears when i compile. So far, … | |
#include<iostream.h> using namespace std; char*ones(int number){ int num = number&&100; if(num>10&&num<20){ return ""; } else { num = num%10; switch (num){ case 1: return "one"; case 2: return "two"; case 3: return "three"; case 4: return "four"; case 5: return "five"; case 6: return "six"; case 7: return "seven"; case … | |
write a function that determine whether a number is prime. | |
I need some help with a problem. I am attempting to insert numbers into a binary tree, then converted it to a rbtree, just curious on how i can change it over i know that 10 (black), 4(red), 5(black), 6(red), 11(red), 12(black), 13(red) as my input. int a[] ={10, 4, … | |
Hello , I have just started dealing with OpenCV and tried to open an sample.I am using version b4a. And when i opened a sample source file(for example:face detect). I compile source file(face detect) and it(visual stdio 6.0) gives 0 error or warning. But when i tried to run it … | |
I have the following integral function with Simpson's rule: [CODE] typedef double real; typedef real real_func(real); real Integral(real_func func, real a, real b, unsigned int N = 1000) {...} [/CODE] It works like: [CODE] real myfunc(real x) { ... } Integral(sin,1,2); Integral(myfunc,1,2); [/CODE] But does not work with a public … | |
I am not able to find a good MFC Tutorial. Do anyone has got a link for a MFC Tutorial which consists from basic to advance. | |
Hi, I would like to learn C++ and become a gaming programmer. Your suggestions to the following are appreciated. Q1) What development software do you suggest (compiler, code editor, ide, etc)? Free versions as well as priced, thanks. Q2) Regarding OS, does anyone recommend Linux over Windows (XP, Vista, 7)? … | |
can anyone answer this question? You are to write a C++ language program that: 1. Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text … | |
| |
Hey, I have to create class diagrams for each of class that I have created. I have currently create 4.. Please could you have a look at the example class diagram and tell me if it looks alright or have I done it completely wrong? Thanks for any help. | |
Hi. :-/ I am trying to create multiple output files while reading a single input file. The multiple files will be created based on the value in the first field. My set1 contains 1,2,3,2,1,3. That is Field1 values. My multimap contains the other fields (field2 and field3). Now what I … | |
I have a function which acts on class member function: [CODE] template <typename ClassType> double Integral(ClassType& obj, double (ClassType::*func)(double), double lower_limit, double upper_limit) {...} [/CODE] This can be call like this from outsie: [CODE] class myclass{ public: double classfunction(double); }; double myclass::classfunction(double x) {...} int main() { myclass probe; std::cout … | |
Hi, from my understanding, if you initialize an object without the "new", it will be only saved in the stack. If the method exits, the object is destroyed. Is that correct? What about this code? [CODE] int main() { string xxx = getText(); cout << "from main() " << xxx … | |
Hi all, I am a beginner to coding. Forgive me if my question is too silly. What I would like to know is can dynamic allocation in a loop result in shortage of memory. what I am trying to do is find FFT of a large no of images in … | |
The idea is to have many MessageBox() calls, each within their own thread. The catch is, each thread has to be dynamically created. At first, being a noob, I tried this: [CODE]void Go[10](void) { MessageBox(NULL, _T("..."), _T("..."), MB_OK); } .......... CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)Go[i], NULL, NULL, NULL); [/CODE] That, obviously, didn't … | |
Hi, I'm fairly new to C++. My project states that I must write a program that will allow the user to view a list of TV shows read from an input file. each show should consist of four data members: show ID, Title, day of show, and time(pm). ID serves … | |
hi everyone i'm new in programing, so don't judge me if i will say something stupid... i'm trying to write i poker game in C++ but have faced with several problems, the first one is how to determine a winner... for example i player hand is: Ace of spades card … | |
Hey, I'm currently learning about classes and I am wondering how to implement a sub-class into a class. I have a class atm called "Person" but I want to create a sub-class called administrators. So would it be: [code] Class person { public: // class methods // class methods private: … | |
Hello, I need some help on processing only even numbers on a counter-controlled do-while-loop, an event-controlled do-while-loop, and event-controlled do-while-loop to process only even numbers that breaks within the loop. I'm new at C++ so help would be appreciated. Thanks. [CODE] #include <iostream> #include <fstream> #include <string> #include <cstring> #include … | |
I need to make a function called “menu” that displays a main menu. This function should return the choice of the user please help!!! | |
I'm attempting to create a computer program that prints a triangle of digits, as well as a "ruler" that measures the user specified width of the screen, showing the width in digits. The ruler must have a tens row and a ones row. The program reads three integers: a) the … | |
Hello guys.. I am really new to OOP (object-oriented programming) with C++. I am trying to make a simulation window program. I have a bit confused about apply linked-list inside the class. I mean, I am trying use linked-list to do adding item menu. Yes, I make the lists of … | |
Hi, I was hoping someone could help me with a C++ string problem. I currently have my program open up a file, read the contents into a string, and then I am trying to look for certain key characters in the string, like < and </. In short, I am … |
The End.