49,766 Topics

Member Avatar for
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
132
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
234
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
121
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
181
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
187
Member Avatar for Phil++

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

Member Avatar for dkalita
0
148
Member Avatar for saarah
Member Avatar for ASFtlink

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 …

Member Avatar for DemonGal711
0
201
Member Avatar for program900

I need to make a function called “menu” that displays a main menu. This function should return the choice of the user please help!!!

Member Avatar for DemonGal711
-4
95
Member Avatar for Towely

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 …

Member Avatar for Towely
0
245
Member Avatar for tiara

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 …

Member Avatar for tiara
0
71
Member Avatar for dylank

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 …

Member Avatar for Clinton Portis
0
380
Member Avatar for Ponomous

Hey, I am trying to write a program that will take the grades from an input file and average them and print them to an output file along with the names and grades. I know i am missing something simple (but ive been staring at this for 6 hours). Here …

Member Avatar for Ponomous
0
316
Member Avatar for fuggles

Does anyone know of a good DirectInput tutorial? Every one I've found adds all kinds of extra stuff into it, and all it gives me are lines of code without explaining the well, or showing me how to fit them all together.

0
44
Member Avatar for poopynoob

#include<iostream> using namespace std; int main() { char name; cout<<"Enter your name.\n"; cin >> name; cin.get(); cout<<"Hello, " << name; cin.get(); } this is what I have.. Very simple program but I cannot get it to work, as soon as I enter two or more letters when debugging, the cmd …

Member Avatar for poopynoob
0
154
Member Avatar for new programer

Dear all, There is some errors in the code that I can’t seem to spot. The code is [CODE]# include <iostream> using namespace std; int main () { int N; // Declaring and initializing variables int n=0; int i=0; int fact=1; cout << "Please Enter an Integer" << endl; // …

Member Avatar for Grn Xtrm
0
337
Member Avatar for abhipro

Hi all, I have a library built in C++ targeted for linux platform. The authors suggested that with some minor changes, it can be compiled in windows as well.. This library in turn uses the mathematical library called miracl, which does support VC++ and I was also able to build …

Member Avatar for Agni
0
240
Member Avatar for dylank

Hi, Im new to DaniWeb and C++ and was hoping some of you more experienced tech fellas could help me out with a problem. I want to open a file, then read it by 5 characters at a time by putting it into a [CODE]char[5][/CODE] type of array, then analyze …

Member Avatar for dylank
0
195
Member Avatar for ross42111

> THe program works - its is the last piece of code I am having trouble with. I am supposed the wirte and function (month_conversion) which changes the int month that is represented in the input by (montnNumber and monthNumber1 input that number which represents the month and conver that …

Member Avatar for sfuo
0
102
Member Avatar for Valaraukar

I've attached some .h and .cpp files so that you can view the code I am having trouble with. Basically the following errors are being thrown: Error 2 error C2059: syntax error : '{' c:\users\simon\documents\visual studio 2008\projects\objects\sprite.h 19 objects Error 3 error C2334: unexpected token(s) preceding '{'; skipping apparent function …

Member Avatar for Valaraukar
-1
215
Member Avatar for Galf

Hi all, My first post here -- I've been trying to update some old code that uses C-style casts into the C++ equivalent, and I've stumbled on one cast that I can't figure out how to convert. This isn't the code that was giving me issues, but it reproduces the …

Member Avatar for Galf
0
175
Member Avatar for kustrle

First look at attached picture. As you can see there is few check boxes. I would like when I click Install it run selected components (mostly .exe or .bat file) If I'm sure I need to add some code to event handler of Install button? Now in event handler there …

0
60
Member Avatar for killerqb

I am trying to optimize my hash function, for a separate chaining hash table that I have created from scratch. My hash function is as follows: [CODE] int hash( const string &key, int tableSize) { int hashVal = 0; for(int i = 0; i<key.length(); i++) hashVal = 37*hashVal+key[i]; hashVal %= …

Member Avatar for Rashakil Fol
0
5K
Member Avatar for Xantox

So I would like to know if there's any way to do the following more efficiently: [CODE]while(g[0] = 0 || g[0] = 1 || g[0] = 2 || g[0] = 3 || g[0] = 4 || g[0] = 5 || g[0] = 6 || g[0] = 7 || g[0] = …

Member Avatar for Sky Diploma
0
119
Member Avatar for vhertie

how can i make a program that the computer will allow the usser to input a number.. then it will turn into a word? example: 1030=one thousand thirty

Member Avatar for vhertie
0
147
Member Avatar for colmcy1

Hey all, writing up some code to copy a string from a text file and extract numbers from the string. What I have so far is: [CODE]#include <iostream> #include <fstream> using namespace std; int main(int argc, char *argv[]){ ifstream in("test.txt"); if(!in){ cout << "Cannot open file."; exit (1); } char …

Member Avatar for Ancient Dragon
0
89
Member Avatar for Your_mum

Hi, I am trying to learn C++, and to a certain extent, yeah, it's going alright so far. but I keep getting problems with header files and the like, so I would be really grateful if you guys could help me out. 1) Can't: #include "stdafx.h" - fatal error:file or …

Member Avatar for Your_mum
0
183
Member Avatar for mcap61

OK, so i need help adding my total_points = temp1 + temp2 + temp3, but everytime they just equal 0. This is a student grade class average program, where you enter a student's info, it gets calculated, then you add the next, after entering all studen't you have to figure …

Member Avatar for rdrast
0
114
Member Avatar for Zay

Hello; read this quastion , what do the last part mean ? do they mean to print the remine cookies that have to be produced to let the number be complated ! or to print the number of cookies that we throw ! -------------------------------------- [B][U]the quastion is :[/U][/B] A box …

Member Avatar for Zay
0
103
Member Avatar for th3learner

hello can any one please write code in simple language tht how to find vowel from string Thanks

Member Avatar for mrnutty
0
118

The End.