49,757 Topics

Member Avatar for
Member Avatar for sabareesh

DrawText with specified Color and Font For that what property i want to use in DrawText Methord? [CODE]// // pDC Client device GetClientRect(&rcPoint); //// create the font VERIFY(fntNew.CreateFontIndirect(&lfFont)); // create font CFont* fntOld = pDC->SelectObject(&fntNew); // set text color pDC->SetTextColor(clrNew); // for display text pDC->DrawText(strText, strText.GetLength(), &rcPoint,0 ); // delete …

0
54
Member Avatar for mybluehair

I've been looking at some tutorials on an easy way to open a c++ thread, but all have different answers and solutions. does anyone have a nice tutorial?

Member Avatar for DELmE
0
154
Member Avatar for Tahir33

Hi,here is another interesting problem that will make you think. The tower of happiness is located in the garden of effort.Happiness is waiting for you in the top chamber of the tower.The stairs that lead you to the chamber has N steps and you are allowed to climb up one …

Member Avatar for Tahir33
-3
205
Member Avatar for baltair

I am trying to break from an infinite for loop, if the user has entered a blank line, but I want to continue if the user has entered a word. here is code to show. [CODE]#include <iostream> using namespace std; int main( void ) { char szMessage[32]; for(;;) { cout …

Member Avatar for baltair
0
112
Member Avatar for hq1

Hi, so I wrote this program to find the GCD of two numbers, the program runs just fine its that I also need it to display how many times it loops, I cant get it to do that. Can some one please tell me what I'm doing wrong, Thanks! [CODE] …

Member Avatar for hq1
0
87
Member Avatar for Ilyana

[code] #include <cstdlib> #include <iostream> #include <iomanip> #include <fstream> using namespace std; int main() { const int SIZE=81; char input[SIZE]; fstream nameFile; nameFile.open("Bands.txt", ios::in); if (!nameFile) { cout << "Error: Cannot open file." << endl; return 0; } nameFile.getline(input, SIZE); while (!nameFile.eof()) { cout << input << endl; nameFile.getline(input, SIZE); …

Member Avatar for Ilyana
0
98
Member Avatar for JCal1108

My task was to write a function that dynamically allocates an array of integers. The function should accept an integer argument indicating the number of elements to allocate. The function should return a pointer to the array. Here is the code I wrote, my pointer returns the starting address of …

Member Avatar for Unimportant
0
117
Member Avatar for Smithy566

Hi all, to simplify my problem, I'll use a quick example. Imagine I have a class of 'Cat' which has accessors for things like 'name', 'colour' and 'height'. I then put these cats in a list [CODE]List<Cat^>^ catList;[/CODE] I want to be able to search this list based on the …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for gerard4143

Hi, I have a question about constructors and the difference between passing by value and by reference. If you look at the two examples I attached. Example one has a constructor that passes by value and example two pass by reference. Now I want to know why example one will …

Member Avatar for gerard4143
0
117
Member Avatar for Violet_82

Hi all, I am trying to make sure that users can only input integers in my program and no other types. Here is the program: [CODE]#include<iostream> using namespace std; int main() { int numbers[9]; int k; cout<<"Enter 9 numbers: "; for( k = 0; k<9; k++) { cin >> numbers[k]; …

Member Avatar for Violet_82
0
141
Member Avatar for raheel_88

I'm having trouble with a for loop! I'm trying to solve a differential equation using Euler's method like so; [TEX]\displaystyle\frac{dy}{dx} = 7{y^2}cos(y^2)-3e^{xy}, \ \ \ 0 \leq x \leq 1 \ \ \ y(0) = 0[/TEX] This is solved using the algorithm [TEX]y_{n+1} = y_n + hf(x_n , y_n)[/TEX] Where …

Member Avatar for Unimportant
0
829
Member Avatar for vbx_wx

Why my program doesnt print ? [code] #include <iostream> using namespace std; class String { string s; public: String(string ss): s(ss) {} string substr(int pos = 0, int n = string::npos) { string str; int j = 0; for(int i = pos; i <= n; i++) { str[j] = s[i]; …

Member Avatar for Ancient Dragon
0
94
Member Avatar for BlueZephyr

I am have some really weird iostream errors. This is my first time using functions. Maybe I did something completely wrong. I just need someone to point out my error and maybe help with building a function to find the minimum value out of 4 input numbers. [code=c] #include <iostream> …

Member Avatar for BlueZephyr
0
116
Member Avatar for Jennifer84

Is it possible to use a buttoncontrol to pause a for loop. Ex: When it has counted to 50000, I press Pause and when I press Pause again, the loop continues. Is it possible to achieve something like this ? [code] for ( int i = 0; i < 100000; …

Member Avatar for WaltP
0
4K
Member Avatar for kra9853

I need to modify my program to use while and for loops and be able to do the following tasks: a. A score of I on the project forces a mid-term grade of I. Notify the user to contact both the student and their advisor of the I grade. b. …

Member Avatar for Lerner
0
121
Member Avatar for Сторм

Hi everybody. I'm new in programming and just started i have found one compiler "Code Blocks" its rate was high though. So i chose it. Wanted to ask any compiler that you guys use? Okay so here is the problem. I wanted to code a few rows. To find a …

0
39
Member Avatar for Vllinator

Hi i need help on searching an array for a match. They can be in any order, and does not need to be in a sequence. The theArray has 6 numbers in each row, with 10 lines (i have made 2 to keep things simple). The randArray has 8 numbers. …

Member Avatar for Lerner
0
99
Member Avatar for bob200707

Could someone help me put the following C++ in correct order. The statements in the following program are not in the correct order. Rearrange the statements so that hte program outputs the total time an employee spent on the job each day. Th program asks the user to enter the …

Member Avatar for Lerner
0
685
Member Avatar for stevanity

Can anyone explain this code used to implement prims algorithm to find min spanning tree [CODE] #include <iostream> using namespace std; int g[20][20],visited[20],d[20],p[20]; int v,e; void creategraph() { int i,j,a,b,w; cout<<"\nVertices: "; cin>>v; cout<<"\nEdges "; cin>>e; for(i=1;i<=v;i++) for(j=1;j<=v;j++) g[i][j]=0; for(i=1;i<=v;i++) { p[i]=visited[i]=0; d[i]=32767; } for(j=1;j<=e;j++) { cout<<"\nEnter (a,b) and cost\n"; …

0
54
Member Avatar for khiah12

how to create a game program using conditional statement, array, loopings and function? plaese..i need help from you guys.. Its for my school pgoject..thanks!

Member Avatar for Lerner
-1
97
Member Avatar for peterman.k

I am going out of town and don't have access to my professor and / or tutors for the weekend, and we have an assignment involving a BST. I have done all of my insert, remove, and search functions, and went to the tutor about the remaining ones I have, …

Member Avatar for peterman.k
0
227
Member Avatar for gregarion

Hey guys, i am having a problem passing my array into a function . What i am trying to do is to pass my array called Alphabets[] from my main into a function called Key. THe issue i am having is that i keep getting an error telling me that …

Member Avatar for LevyDee
0
112
Member Avatar for marvik

Write a program that will determine the additional state tax owed by an employee. If the state charges a 4% tax on net income determine net income by subtracting a $ 500 allowance for each dependent from gross income. Your program will read gross income number of dependent and tax …

Member Avatar for Ancient Dragon
0
82
Member Avatar for phfilly

hi guys I got this weird error which I cannot debug in my code. The program is to convert Roman numerals to Arabic numerals using the Interpreter design pattern. Here is a part of the program where the errors occurs RNInterpreter.C:8: error: new types may not be defined in a …

Member Avatar for phfilly
0
201
Member Avatar for azim_axl

Hi all, I'm new to C++ & taking my first class in programming. The program ask the user to enter the loan amount, number of years, and interest rate, and then displays the amortization schedule for the loan.The monthly payment for a given loan pays the principal and the interest. …

Member Avatar for Ancient Dragon
0
972
Member Avatar for fire_

Hi. How can i make Dialog box visible only in one application window for examlpe only on firefox? I'm using MFC. Thank you

Member Avatar for fire_
0
93
Member Avatar for ielo

[CODE][/CODE]I thought I knew how to use vector and manage insert, push_back and erase, but apparently I don't. I encounter an unexpected outcome when i attempt to erase the second element in a vector of four: the element is removed, yet the content of the element following it is modified. …

Member Avatar for ielo
0
95
Member Avatar for andimiami

How do I write this C++ sentinel-controlled while loop? I need to write a sentinel-controlled while loop to see if the coefficients of a quadratic equation have real roots using a nested decision. A character q must be my sentinel. This is what I have so far, but it doesn't …

Member Avatar for Ancient Dragon
0
724
Member Avatar for raider650

Everything runs fine, except the Lowest Temperature and HIghest Temperature do not output correctly. Also any suggestions on how I could implement vectors, Any help would be greatly appreciated. Thanks. [CODE] #include<iostream> using namespace std; int main() { int i(0); double Calc(double fahren); double Total(0),Celsius[5],Fahrenheit[5]; double CelciusLowTemp(0), FahrenheitLowTemp(0), CelciusHighTemp(0), FahrenheitHighTemp(0); …

Member Avatar for stevanity
0
108
Member Avatar for Borzoi

I haven't done any C++ programming for quite a while now and the last compiler I used was Dev C++ (not sure which version/release but likely an old one). I want to start programming in C++ again but I'm an unaware of which free compiler would be the best to …

Member Avatar for stevanity
0
109

The End.