51,593 Topics

Member Avatar for
Member Avatar for Coding Mage

Hi all, I have an interesting problem for which I already have a solution, but I have a feeling my solution is less than elegant. I need to create a Factory class which returns an instance of some child of class Foo. Which child is instantiated depends on the value …

Member Avatar for Dave Sinkula
0
622
Member Avatar for muthuivs

Ladies and Gents, I am trying to write a function in my ever growing program to give me information on a selected folder. I actually only need the number of files in the folder so I can use that number in a loop. Is there a way to get the …

Member Avatar for GloriousEremite
0
398
Member Avatar for joshilay

can anyone tell me the code for inorder traversal of binary tree non recursively and using a constant memory ...??

Member Avatar for Laiq Ahmed
0
169
Member Avatar for iamthwee

This is really ticking me off. Ok I have a program like so:- [CODE] #include <iostream> #include <string> using namespace std; int main() { string crap = "dfgfd-rergreg-dfgfdg-ertertd-gfdg-df"; }[/CODE] And all I wanna do is replace the [INLINECODE]"-"[/INLINECODE] with [INLINECODE]" - "[/INLINECODE]. Note the spaces. I've tried everything but it …

Member Avatar for iamthwee
0
201
Member Avatar for Marthy

[I] What is the Importance and uses of data stuctures in Programming using C/C++ when using it? .How Stack,Queue,and list works and give example problem that solve stacks (note:this is not a code program).t.y..i want your different opinions...pls...reply this tread.. [/I]

Member Avatar for Laiq Ahmed
0
90
Member Avatar for tefflox

Hello, this is my first post here. I'm taking c++ as an elective course, and I'm doing great until now. The problem I'm having is taking data from a txt file formatted line by line [inlinecode]#### # ##[/inlinecode] for product id, store number, and quantity. I'm supposed to read this …

Member Avatar for tefflox
0
232
Member Avatar for comwizz

hi , I just was trying to implement a stack using doubly linked list . Well , i cannot exactly find out the error. Any hint would be of great help. Heres the code [code] #include<iostream.h> #include<conio.h> class abc { public: int num; abc* next; abc* previous; friend void push(abc*,int); …

Member Avatar for Lerner
0
4K
Member Avatar for vikter
Member Avatar for blewis999

I saw the code snippet by vicki_dev for drawing a function using turbo C on windows and wondered if there was anything like this or even this code with the calls to the OS inline. I don't have an OS on the embedded systems I work on and need a …

Member Avatar for Salem
0
107
Member Avatar for ethompson

Hello, I'm having some problems with trying to get my random numbers to go in ascending order and descending order as well and trying to figure out how to get when I put in a number between 2 - 25 how to get the highest number out of the random …

Member Avatar for ~s.o.s~
0
2K
Member Avatar for DotNetUser

I'm coding in VC++.NET 2003. I have panels that will be populated with buttons dynamically. In my static callback function, I get an exception when I try to add the button to the panel. //Exception: Controls created on 1 thread cannnot be parented to a control on a different thread …

0
65
Member Avatar for bkaau

For all programmers please help me I have only for day to submit my final project so please pleas help me. Before i goto my problem. i can introduce my selif. i am biruk i live in Ethiopia (Addis Ababa). i am 20 years old . i study Statistics in …

Member Avatar for WolfPack
0
232
Member Avatar for gampalu

Hi! How in C++ can we make a pause in the code, waiting for an ENTER? regards

Member Avatar for Dave Sinkula
0
117
Member Avatar for madhan

[COLOR=black]Thank you so much for looking at my question and helping me to get start. I am new to programming. I am currently executing c/c++ programs in VC++ compiler all by my own. I have created very basic programs like displaying the content, find the entered number is odd or …

Member Avatar for iamthwee
0
119
Member Avatar for ostkaka

I´m trying to put in a variable called "sex" in this program but it does´nt work, i wonder if anyone can help me with that? [code] #include <iostream> using namespace std; int main() //viktigaste delen av programmet { int age; //En variabel som heter age; int sex; cout<<"please input your …

Member Avatar for Dave Sinkula
0
105
Member Avatar for TJW

Why is the last element not 7 [Code] int array[3]; int *ary; ary=array; array[0]=0; array[1]=0; array[2]=0; array[3]=44; for (int i=0;i<4;i++) { cout<<array[i]; } cout<<endl; *(ary+0)=1; *(ary+1)=0; *(ary+2)=0; *(ary+3)=7; for (int i=0;i<4;i++) { cout<<array[i]; } cout<<endl; [/CODE] Output 00044 1003<-----------------Why 3 and not 7!!!!!!

Member Avatar for Dave Sinkula
0
194
Member Avatar for rochester

I was hoping that you could help me with some problems colleagues and I are having with a psychometric tool that we are developing for a short-term project. We were hoping to utilize Visual Basic C++ to get the job done. What we are essentially trying to do, but can't …

Member Avatar for iamthwee
0
146
Member Avatar for gerik

I've checked through the book list tagged on this forum, very helpful, but far too many books listed to efficiently check them all out. I already have one book on c++ (the teach yourself in 21 days), and it's nice, lots of short and to the point examples, but their …

Member Avatar for server_crash
0
119
Member Avatar for akshay_goel

I wud like u to suggest me some project in c++ or in computers for summer training for 1 month . I have just completed my 2nd year of b.teh

Member Avatar for happygeek
0
25
Member Avatar for conryf

I'm writing a program in VC++ 6.0 professional and am encoutering a baffling error. The program compiles fine, but seems to be fed up with anymore member functions. If I add one in the header implementation it still compiles but if I call that function anywhere in the program I …

Member Avatar for Dave Sinkula
0
122
Member Avatar for invinate

Hi, i've been reading about c++ advanced concepts such as polymorphism, (multiple) inheritance, templates, operator overloading and others. It all seems more or less clear to me but i know i would never really understand all these language features until i've used them. the problem is that i don't know …

Member Avatar for invinate
0
126
Member Avatar for dilip.mathews

Hi all, I created a string object and printed its size. Its always priniting output as 16. Why is it like that? Can anyone give me idea about how string class is implemented. I am using VC [COLOR=blue]string input; cin>>input; cout<<sizeof(input)<<input<<'\n';[/COLOR]

Member Avatar for Narue
0
123
Member Avatar for priya_2006g

[B]Hi Everybody, i am working on C++ and Oracle both but now i want to connect them,i want to retreive data fron SCOTT database of oracle using C++....i have no idea about it please help me....how to write a program,what steps to follow..[/B] [B]Priya[/B]

Member Avatar for priya_2006g
0
249
Member Avatar for Zilla32167

I am a student doing a research project at NIST, and as part of my project I have to run a series of simulations. My problem is this: I inherited the C code for the simulations from a previous student researcher who wrote it using Microsoft Visual C++ on a …

Member Avatar for Zilla32167
0
83
Member Avatar for paramveer

Hello group, Could anyone of you tell me how to convert string to const char* in C ....function c_str() is not working ...i dont know why............ Thanks...

Member Avatar for Narue
1
112
Member Avatar for Kumal

I can't seem to use the 'cin.get' statement for getting character arrays. I've just switched to VC++ Express, from Dev-Cpp, which allowed that. I have tried other methods like declaring the variable with 'string' but the compiler doesn't recognise it even with the <string> header. [code] void encrypt() { string …

Member Avatar for WolfPack
0
154
Member Avatar for deadprogrammer

Hi everyone I am really having trouble right now with oracle for linux. Please tell me how to connect oracle using c/c++ in linux. If anyone knows about any tutorial or have code, please plzzz post me that as well.

Member Avatar for WolfPack
0
167
Member Avatar for wani_raj
Member Avatar for rowin

Hi, is there a function to send a mail in C++ Builder? Kind Regards, Rowin

0
51
Member Avatar for tejuarora

[COLOR=black]Your cell phone provider bills you for minutes consumed per month. The billing rate per minute varies by time of day. The cell phone company rounds usage to the nearest N where N is dependent upon the time of day. Write a C# method based upon the following signature that …

Member Avatar for alc6379
0
91
Member Avatar for rehmankhan

Please help me here. I am having problem in solving my home work problem in C++. I have attached my home work in a word doucment here. My home work is due on July 13th. I will be thankful. Thanks a lot.

Member Avatar for rehmankhan
0
111
Member Avatar for ostkaka

I have just started with a tutorial in c++ and i wonder if anyone can tell me what´s wrong with this code [code]#include <iostream> using namespace std; //so the program can see cout and end1 int main() { for (int x = 0; x < 10; x++) { cout<< x …

Member Avatar for dilip.mathews
0
79
Member Avatar for FireNet

K, It's fairly easy to use a ostringstream object or a derived class to output text like a normal stream class like cout. Eg. [code] class console: public ostringstream { public: void Render() { std::string buff = ostringstream::str(); //Some code to put it to screen //Write it to a file …

Member Avatar for FireNet
0
539
Member Avatar for dilip.mathews

Hi, I am bit confused with the concept of pointer to a data member of a class. In the below program what actually will the pointer variable be storing? When i tried printing the value of address I got value 1, Whatt does it mean? [COLOR=blue]class A{ public: int d; …

Member Avatar for dilip.mathews
0
171
Member Avatar for uxohus2b

Hi, Could someone tell me how I can delete files using a shell script or c++? The condition for deleting files: compare all files (say *.deb files) in folder A to those in folder B. If any file in B is also contained A, then delete the one in B. …

Member Avatar for uxohus2b
0
106
Member Avatar for ChimpusDupus

Hi, I've been wondering for a long time how one program can affect another program during run time by adding featues, retrieving information, submitting information and those sorts of things. One example of this might be a program like DeadAIM, which affects AOL Instant Messenger, or (doubtedly) if your in …

0
59
Member Avatar for zidane28

Help!!!!! I'm sorry to ask for help again but...... This question even difficult than the previous one..... Please write C++ code for the following algorithm: 1) Store first memory location of program into base register 2) Set program counter equal to address of first memory location 3) Load instruction of …

Member Avatar for WolfPack
0
148
Member Avatar for zidane28

Halo....I'm new here...... Can somebody help me with this question? Its a assignment but I REALLY DON HAV ANY IDEA HOW TO DO IT!!!! So....Plz help...... Write C++ code for the following algorithm: 1) Determine job's reqeusted memory size 2) if job_size>size_of_large_partition then reject job print appropriate message Go to …

Member Avatar for zidane28
0
121
Member Avatar for jatinder kumar

Hi,My name is Jatinder Kumar from India(Punjab).I have done B.Tech. in Electronics & Communications Engineering.Iam interested in software programming .I have also interested in hardware.

Member Avatar for Dani
0
44
Member Avatar for TuoPohc

I'm not going to post the code on this one just incase it's a little confusing. But here's the jist: I have a couple of nested loops with multiple (var)++'s inside as counters. Each counter resets itself after reaching 25 and the total of the counters much equal 120 in …

Member Avatar for TuoPohc
0
92
Member Avatar for winbatch

So here's what I'm trying to do. Basically, I have a huge text file of strings which are delimited by a delimiter. I would like to read each string separately based on the delimiter. Note that each chunk can span several lines, so I don't want to read it line …

Member Avatar for Ancient Dragon
1
221
Member Avatar for amethystglow

Given a set of data (two columns of data, flight path angles and lift coefficients) in a separate file, I need to write a program so the user can input a flight path angle and the program will return the appropriate lift coefficient given (if their angle matches one in …

Member Avatar for Salem
0
145
Member Avatar for kakeen

Yea, just recently I enrolled into a basic computer programming class. We use Turbo Visual C++ and umm so far it went okay until we talked about do-for-while loops... Can anyone help in making a program in loops >_< I mean I tried using the goto statements but my professor …

Member Avatar for WaltP
0
139
Member Avatar for Munoz

I am trying to display a database into textboxes without using Datagrids. How do you give a value to a text box that corresponds with a Sql row. Thanks.

Member Avatar for tgreer
0
106
Member Avatar for slacke

I start to write a code for a shell with some basic functions: open files, save files, create files... I try to use the ifstream for opening files. I found the constructor - ifstream openfile("file.txt", ios::in); I try to use this constructor in the way (function openfile()) that I can …

Member Avatar for Dave Sinkula
0
102
Member Avatar for thlegendkiller

good day, I am an incoming 2nd year IT student and am encountering a problem in creating a "turtle graphics"(from the famous Logo Language) program using C. This case is found in the book of deitel and deithel, "C how to program" in the chapter of Arrays. it has almost …

Member Avatar for Dave Sinkula
0
1K
Member Avatar for dev.cplusplus

Hi, I'm looking for a function that will convert CString to char*, I found the function [code] char* ConvertToChar(const CString &s) { int nSize = s.GetLength(); char *pAnsiString = new char[nSize+1]; memset(pAnsiString,0,nSize+1); wcstombs(pAnsiString, s, nSize+1); return pAnsiString; } [/code] The problem is you cann see that there is the use …

Member Avatar for Ancient Dragon
0
168
Member Avatar for Darkmeerkat

Hello, I've got three files, [b]main.cpp[/b], [b]test.h[/b] (the header file), and [b]test.cpp[/b], (implementation of [b]test.h[/b]). Both [b]main.cpp[/b] and [b]test.cpp[/b] #include [b]test.h[/b], but I don't seem to be able to get [b]test.h[/b] to use the implementation in [b]test.cpp[/b] (leading to "undefined reference" errors when attempting to compile). Searching Google, I've found …

Member Avatar for Darkmeerkat
0
97
Member Avatar for hanabyha

i have to make a program for cinema management system. here i include the question and the source code that i've made before. question: ---------------------------------------------------------------------------- [COLOR=black]. Students are required to design a Cinema Management System program that can perform the following functions (this program should depict the online system of …

Member Avatar for iamthwee
0
198
Member Avatar for HelmsK85

A farmer has a bunny farm. He has cage capacity for a limited number of bunnies. A pair of adult bunnies will give birth to 2 bunnies (1 male and 1 female) at the end of every three months. A bunny is an adult when he or she reaches the …

Member Avatar for Dave Sinkula
0
206

The End.