49,761 Topics

Member Avatar for
Member Avatar for jaux

Yesterday I saw a question that was asking to prevent creating objects on heap. After some thoughts, I came out the following: [code] class Foo { public: Foo(const Foo& f) {} static Foo getAnInstance() { return Foo(); } private: Foo() {} }; [/code] But this can only guarantee the first …

Member Avatar for jaux
0
116
Member Avatar for ahmed_hossni

hi all ;; i'm so glade to join u ,, i want ti ask about my problem in using borlandc++ 3.11 under windows vista home edition , i wrote the following program ..& i runs perfect on windows xp(on my desktop computer) but while trying it on my laptop dell …

Member Avatar for ahmed_hossni
0
103
Member Avatar for zizimetalique

i have to write the count_sentence and the to_lower function assuming the the first parameter is the character array holding the text. The count_sentences function should find the number of sentences in the text by counting periods, question marks, and exclamation points. so far this is the code that i …

Member Avatar for Ancient Dragon
0
94
Member Avatar for mikp_mik

hi friends iam working with c graphics i need to convert color images to grey scale using c graphics. If any algorithm available to help me please post.. waiting for replies.

Member Avatar for Duoas
0
136
Member Avatar for tweedsmuir

New member. Got to this site by Googling "programming vista C++"; wild thread exchange from a couple of weeks ago with implications that some folks might have the answer I need. Basic question is whether my partner & I can adapt a longstanding, robust C/C++ program we've been marketing so …

Member Avatar for jbennet
0
140
Member Avatar for talk2tisa

Hi again, I've figured out how to get the program to do what I need it to do, except it is doing the last thing twice and I can't figure out how to change it so it does it only once. Please provide some direction. I've attached the files.

Member Avatar for WaltP
0
99
Member Avatar for johny112

this is the exact problem: Write a routine to sort the ten-number list shown in ‘Sample Screen Output’ below, and then make the following modifications to improve the performance of the bubble sort: Sample Screen Output Data items in original order 2 6 4 8 10 12 89 68 45 …

Member Avatar for WaltP
0
93
Member Avatar for rayy

i want to write a c++(console) programme for a voting system that accepts names of candidates and the votes they had and sort these votes in descending order to show the winner. how do i go about it. thanks. this is the what i have been able to do so …

Member Avatar for Nick Evan
0
82
Member Avatar for Nidaa87

radix sort: an example : Original, unsorted list: 170, 45, 75, 90, 2, 24, 802, 66 Sorting by least significant digit (1s place) gives: 170, 90, 2, 802, 24, 45, 75, 66 Notice that we keep 2 before 802, because 2 occurred before 802 in the original list, and similarly …

Member Avatar for Nidaa87
0
92
Member Avatar for bpage

Hi, I am trying to do a pretty basic project for my computer science class. The part that is giving me trouble is where the user needs to input every letter of the alphabet in a random order but only each letter can be inputted once. I was wondering if …

Member Avatar for bpage
0
157
Member Avatar for driplet

there is a intrinsic function, ichar(C), to convert character to a numerical value (ASCII?) in FORTRAN. Can any one tell me a similar function in C++?

Member Avatar for Ancient Dragon
0
88
Member Avatar for mugenoid

I am doing a game and i need to refresh the screen to make it less messy, Can anyone teach me how to do plz?

Member Avatar for FireNet
0
731
Member Avatar for mr.cool

in my c++ class we have to make a game and i need some ideas on what to make. the only thing i have learned is: random numbers, ifs, switch case, while loop, for loop, some character string functions of cin.get and cin.ignore, also declaring a character string, data formatting …

Member Avatar for ithelp
0
89
Member Avatar for tonyaim83

Hi My input file is as below. AXY,21,23,12,334,34 VBE,32,34,32,43,34 AXX,32,34,45,32,45 AXY,23,43,323,122 VBE,23,3,323,21,121 Now here the first token designate the nodal name. Now what i want is to create a set of file name AXY_info.txt,VBE_info.txt,AXX_info.txt and here file name designating the nodal name and each file should contain their respective values. …

Member Avatar for WaltP
0
163
Member Avatar for hpr12951

Could ppl please fix my 2 codings to "template version". I spend so much time understanding template, but still hard for me! Please help~ thanks to all [CODE]#include <iostream> using std::cin; using std::cout; using std::endl; const int ARRAY_SIZE = 10; void search(const int a[], int lowEnd, int highEnd, int key, …

Member Avatar for hpr12951
0
121
Member Avatar for guccica

Hi all, would need your help on unzipping message which is zipped with java.util.zip. For your information my module was written in c++. Currently i am trying to unzip with zlib, how ever it failed with "Z_DATA_ERROR" error. Please advice.. thanks a lot. regards brandon

Member Avatar for guccica
0
117
Member Avatar for death_oclock

I am trying to write an openGL application from a tutorial I found and tried to copy it as accurately as possible without just copy+pasting it, so I can actually learn the code. The source file from the tutorial compiles and runs perfectly, but my code fails at a call …

0
127
Member Avatar for sbenware

I have a binary tree program that is trying to retrieve a name. I've already inserted names into the tree correctly and can see this at output. Now I'm trying to check for a name in the tree and calling that input "key". My program wants to take that key …

Member Avatar for sbenware
0
152
Member Avatar for #include<DAN.h>

Does anyone have a list or know how I can get a list of the bit addresses of keys used in the getch (); fuction. For example: F1 is 59 F2 is 60 F3 is 61 F4 is 62 F5 is 63 etc. I'm pretty sure that this is the …

Member Avatar for guy40az
0
121
Member Avatar for talk2tisa

I am attempting to complete a homework assignment. The progam basically requires input from the keyboard into an array and then to perform some calculations on the input information. I believe I can do the calculations, but I cannot figure out how to get the input into the array. The …

Member Avatar for talk2tisa
0
108
Member Avatar for robotnixon

So below is a working program I wrote that mimics a rolodex. It stores the information on a text file with the number of cards listed at the top of the file and one card per line like this: last first phone email last first phone email ... I'm currently …

Member Avatar for robotnixon
0
118
Member Avatar for guy40az
Member Avatar for Ancient Dragon
0
98
Member Avatar for jacknight

Why does (start+last)/2 work to calculate the midpoint while start+(last-start)/2 does? To be more specific, I put the contents of a binary tree into an array, sorted it, destroyed the old tree, and plan to rebuild the new one. I know that start+(last-start)/2 as a midpoint calculation works correctly. My …

Member Avatar for Narue
0
146
Member Avatar for Max_Payne

[b]***Header Files:[/b] [b]Point.h[/b] [code=c++] #pragma once #include <iostream> using namespace std; class Point { private: int x; int y; public: Point(void); Point( int x, int y ); Point( const Point &xPoint ); ~Point(void); void setX( int x ); int getX() const; void setY( int y ); int getY() const; Point …

Member Avatar for Max_Payne
0
116
Member Avatar for Biro

Hey, I have started working with I/O file streams using my 'problem solving with c++' book, I am not sure where the .dat file goes in MS Visual C++ or how to make it for that matter... Also is this code correct? I am getting strange errors... I am trying …

Member Avatar for Salem
0
899
Member Avatar for hugvc333

Hii.... Please help me... The use of inline function in C++ is usual.But What is the advantage of using 'inline' function ? Can a function be forced as inline?

Member Avatar for Jishnu
0
100
Member Avatar for ravisen22

Hey, Me too have some doubts. When do we need to use forward declaration? Can anybody show one example?

Member Avatar for Jishnu
0
63
Member Avatar for samtben111

Hii, What is the mutable keyword? When do we use this mutable keyword? what are the differences between a pointer and reference?

Member Avatar for Ancient Dragon
0
68
Member Avatar for atiti.m001

Hello guys, Mention the usage of the scope resolution operator? show one example . What is the const keyword ? Illustrate its various uses?

Member Avatar for Ancient Dragon
0
45
Member Avatar for tonyaim83

Hi. Hi My program takes the user input of the location where the directory need to be created. I found Windows API: CreateDirectory() but then for Linux i need to write some other function. Is their any function which can work for both operating systems. Kindly help

Member Avatar for Ancient Dragon
0
96

The End.