49,761 Topics

Member Avatar for
Member Avatar for Free1ancer

hi, Im trying to have a function that would return a pointer and i cant seem to figure out what it is that the compiler complaining about. I got the following error: 80 expected constructor, destructor, or type conversion before '*' token 80 expected `;' before '*' token heres an …

Member Avatar for Free1ancer
0
121
Member Avatar for Kimmelivim

I have an assignment where I need to input a certain value, and the computer will then run through an 'txt' file to see if the value is in there, otherwise it will ask you if you want to create a new value or make a new input. [code] ifstream …

Member Avatar for Kimmelivim
0
164
Member Avatar for hezfast2

Hello, I've written a knight's tour program and handed in a working version of it already using a bunch of if statements for each possible move. I really wanted to use a couple of arrays for the moves and consolidate my code more, but I ran out of time. I …

Member Avatar for hezfast2
0
103
Member Avatar for poopynoob

Hello, I am new to c++ and attempting the for command. This is my code #include<iostream> #include<string> int main() { for (int x=1; x<=10; x++) { cout <<"Hello"; } } but the error : undeclared identifier comes up for cout. I have tried other commands such as cin but none …

Member Avatar for Grn Xtrm
0
175
Member Avatar for Unix*

I reached another part of my program where I have the following statement which prints out these values on screen. printf(" %d %d %d %d %d %d %d(%.1foC) %d %d(%s) %d(%.2f) %d(%s) %d\n", year, month, day, hour, minutes, evtStart, temperature, tempDegC, checksum, basicSelfTest, bstResult, batteryVolt, (float)(batteryVolt*0.0198), powerUpCode, statusCode, timeElapsed); I …

Member Avatar for William Hemsworth
0
149
Member Avatar for monita
Member Avatar for Tom Gunn
-5
68
Member Avatar for TechComm

I need to make a program that reads the program its self and echo prints it to the screen. I appreciate any help. For example if the program was: [CODE] <iostream> using namespace std; int main (){ //This is my program } return 0; [/CODE] My output would be this …

Member Avatar for TechComm
0
481
Member Avatar for NinjaLink

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 …

Member Avatar for DemonGal711
0
165
Member Avatar for iris88

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??

Member Avatar for Tom Gunn
0
121
Member Avatar for eliza2044

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 …

Member Avatar for eliza2044
0
6K
Member Avatar for Qmage

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] …

Member Avatar for Qmage
0
398
Member Avatar for anbuninja

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. …

Member Avatar for dgr231
0
163
Member Avatar for NinjaLink

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, …

Member Avatar for VernonDozier
0
140
Member Avatar for kingbarry90

#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 …

Member Avatar for Unix*
-1
98
Member Avatar for rechene
Member Avatar for Unix*
-4
104
Member Avatar for NICEGUY123

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, …

Member Avatar for Tom Gunn
0
94
Member Avatar for platinn

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 …

Member Avatar for Muaz AL-Jarhi
0
364
Member Avatar for merse

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 …

Member Avatar for Tom Gunn
0
145
Member Avatar for ankur_

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.

Member Avatar for Ancient Dragon
0
172
Member Avatar for breckj

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)? …

Member Avatar for Ancient Dragon
0
93
Member Avatar for sha9n

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 …

Member Avatar for Ancient Dragon
-1
82
Member Avatar for rechene
Member Avatar for Phil++

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.

Member Avatar for Phil++
-1
82
Member Avatar for Web_Sailor

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 …

0
71
Member Avatar for merse

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 …

Member Avatar for merse
0
161
Member Avatar for racumin

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 …

Member Avatar for mrnutty
0
130
Member Avatar for chiraag

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 …

Member Avatar for chiraag
0
232
Member Avatar for FBIRyan

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 …

Member Avatar for FBIRyan
0
117
Member Avatar for ViP3l2

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 …

Member Avatar for DemonGal711
0
179
Member Avatar for Renas

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 …

Member Avatar for Clinton Portis
0
183

The End.