49,760 Topics

Member Avatar for
Member Avatar for hail2dthief

I'm using visual c++ compiler and I want to change the text color in my c++ dos program. What choices do I have if i don't wanna use system function (example: system("color 0a"))?

Member Avatar for Ancient Dragon
0
23K
Member Avatar for amcath

Hi Could you please tell me how to solve this simple problem in c++. #include<iostream.h> #include<conio.h> void main() { clrscr(); int a=5,b=3; int y=a-b++ * --b; /* manually I get the answer as 6 , but the compiler gives as -4 . how?*/ cout<<y; getch(); }

Member Avatar for deceptikon
0
246
Member Avatar for hatre
Member Avatar for samtechae

hae all, how can one make a program that will count number of items in an array and also insert item at certain positons in an array.Thanks in advance...

Member Avatar for anku gupta
0
127
Member Avatar for TheDarkHorse

I really need help with this. If anyone could guide me, please let me know. - Sincerely, thank You

Member Avatar for rubberman
0
111
Member Avatar for muneebhasan

Imagine you are developing a software package that requires users to enter their own passwords. Your software requires that user’s passwords meet the following criteria: • The password should be at least six characters long. • The password should contain at least one uppercase and at least one lowercase letter. …

Member Avatar for richieking
0
295
Member Avatar for chubbyy.putto

How can i get this code to show once and it counting all the positive? When i enter a 10 numbers. it show The positive are.... The positive are.... The positive are.... The positive are... The positive are... ... until 10 can someone show me how to make it show …

Member Avatar for Ancient Dragon
0
172
Member Avatar for javed.iqbal.3979

Hi all,, A module of my Bank Management System which should display the user account details after successfuly entering his/her details calls to a function: void display_acc(int n) { account acc; int flag=0; ifstream inFile; inFile.open("account.txt",ios::in); if(!inFile) { cout<<"File could not be open !! Press any Key..."; return; } cout<<"\nBALANCE …

Member Avatar for NathanOliver
0
151
Member Avatar for nhrnjic6

program works fine until I call print_List function : void print_List() { Vagon *kondukter = head; while(kondukter != 0) { cout << kondukter->num<<" "; kondukter = kondukter->p_next_num; } cout << kondukter->num<<" "; } and that it opens some some new boxs that says : win checking for solutions. I used …

Member Avatar for nhrnjic6
0
320
Member Avatar for javed.iqbal.3979

Hi Coders!!! I am developing a Bank Management System ..In one of its provided facility i.e.new account creation i am having problem with gets(name) . void account::create_account() { cout<<"\nEnter The account No."; cin>>acno; cout<<"\nEnter The Name of The account Holder :\n"; gets(name); cout<<"Your name is :"; puts(name); //for check purpose …

Member Avatar for Ancient Dragon
0
194
Member Avatar for _Nestor

I have a question about how the message loop works in a windows application [code] while ( GetMessage(&msg, NULL, 0, 0) ) { TranslateMessage(&msg); DispatchMessage(&msg); } [/code] Does the windows o/s maintain a message queue that the app retrieves a message from the front of then dispatch it bck to …

Member Avatar for shinejos
0
375
Member Avatar for haider885

runtime error "not recognized as an internal or external command, operable program or batch file" # include <stdio.h> # include <stdlib.h> # include "iostream" using namespace std; int main() { char ch; cout<<"Do you want to Logoff your computer now(y / n) \n " ; cin >> ch; if (ch …

Member Avatar for haider885
0
113
Member Avatar for Felix Arba

Hey guys ! I hope I'm not posting this topic in wrong place . I'm new to DaniWeb forum , although I've been previously following certain articles as a guest . Anyway , let's get to bussines . I have this problem , as titles says , I need to …

Member Avatar for Felix Arba
0
176
Member Avatar for rowen_1

1)How would you give a short and good explaination to someone who is a beginner in programming of the following * short * long * typedef * const

Member Avatar for deceptikon
0
173
Member Avatar for klika

So i have to write a c++ program for the Graeffe's square root method I have am stuck here when i have this formula transform into c++ code, the formula is on the link The code works particulary, the (elem[j-1]*elem[j+i]) doesn't work, it's beeing ignored and i don't know why... …

Member Avatar for tensity
0
1K
Member Avatar for triumphost

I've created: #include <streambuf> #include <iostream> #include <windows.h> template<typename T> class BufferedStream : T { private: T &stream; std::streambuf* buffer; //planning to use this to create other "IO" functions. public: BufferedStream(T &stream) : stream(stream), buffer(stream.rdbuf()) {} ~BufferedStream() {stream.rdbuf(this->buffer);}; std::ostream& operator << (const char* data); std::ostream& operator << (const std::string &data); …

Member Avatar for Ancient Dragon
0
269
Member Avatar for anoniya ze

an int function cube () that returns the cube of its single int formal parameter please attach in my emile bmekixavi@gmail.com

Member Avatar for Learner010
0
133
Member Avatar for klika

The part for(int i=1; i<n; i++) { x[i]=sqrt(y[i]*i); cout<<"x"<<i<<": "<<x[i]<<endl; } isn't working wll, for some elements the result is non, i thought that i because the numbers are complex, but not with include complex i get the same resut.. can anyone help me #include<iostream> #include<math.h> #include <complex> using namespace …

Member Avatar for ddanbe
0
133
Member Avatar for isralruval

how would i write a function that parses a hex number as a string into a decimal integer. I have the following done i just need help finishing it. any help will be appreciated[code]#include <iostream> #include <string> using namespace std; int parseHex(const string &hexString) int main() { cout << "Enter …

Member Avatar for sheetal Phapale
0
4K
Member Avatar for kbear23

I am new to CPPUnit testing and have written test for login authentication function with various test cases. But it only accepts return value zero. The first test case should return 1 if expected and actual are the same but it only works when I change to zero. Any advice …

Member Avatar for Ancient Dragon
0
246
Member Avatar for sohail.butt.144

i need help to make this program please help me Problem Statement: Write a program using class(constructor, destructor, other member functions) to find the frequency of letters (small and capital alphabet or digit) from your student id character string. For example, frequency of letter ‘4’ in the string of a …

Member Avatar for lala56565
0
185
Member Avatar for hahahanz

not sure where to post this but anyways I wrote this code to calculate the max profit from a 5 kg max weight. heres the code. there is an error with the price. when I use small values below 20 its all normal but when I input large values there …

Member Avatar for iamthwee
0
115
Member Avatar for bigjam

hi, I am bigjam and I want to become good in game development using c++. pls what advice can u give me?.

Member Avatar for richieking
0
83
Member Avatar for qalooc

Question1)a program in c++ that display the following pattern to the screen: s ss sss Question2) The Fibonacci series in c++ please help!!!!!

Member Avatar for deceptikon
0
51
Member Avatar for 2concussions

Hello!! So I just started moving over from Java to C++ and am having problems. All I am trying to do is make a simple MessageBox and when I try to run this code: #include <windows.h> int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd){ MessageBox(NULL, L"Hello World!", L"Hello …

Member Avatar for rubberman
0
261
Member Avatar for tessa.burkhalterblackmon

Below is my code so far that ask user for how many numbers they want to input. This program can calculate average based on the numbers that the user input but I also need it to find the product or multiplication of all the numbers entered. I know how to …

Member Avatar for tessa.burkhalterblackmon
0
377
Member Avatar for nhrnjic6

How do I add second element ? right now it works and I get output of 13, but lets say I want list of 2 elements, how do I do that ? here's my code : #include <iostream> using namespace std; struct Vagon{ int num; Vagon *p_next_num; }; int main() …

Member Avatar for AndrisP
0
167
Member Avatar for frew
Member Avatar for raliot

File does not work.Does not record information.Please help! -Enter of a keyboard and a file into an array (by adding) data to 30 girls #include <iostream> #include<fstream> #include <stdio.h> #include <stdlib.h> #include <string> using namespace std; #define N 30 FILE *fp; struct girl { char number[10]; int age; int bust …

Member Avatar for cherrymae.calma
0
283
Member Avatar for folabidowu

write a C++ program which inputs litre consumption given in miles/gallon and which translates these figures into the litres/kilometre format which is more common in Europe.Use the following conversion factors: 1 mile=1.609km and 1 gallon= 3.785litres

Member Avatar for cherrymae.calma
0
274

The End.