51,593 Topics
![]() | |
This program passes two parallel arrays ta a function that prints the grade reports i.e Jay Rino -- Grade: A, I had coded this program as per my knowledge but it does not executed well please help me solve this. I know there is no user input needed but I … | |
Hi, new learner to C++. I have to write 4 functions to compute and return the diameter, circumference, etc. of a circle. I think I might be on the right track but I'm probably making this harder than it has to be. I commented most code out because I'd like … | |
This program runs perfect just want to know if I have to do this arithmetic operations using functions how can I do that? [code] // Arithmetic.cpp - This program performs arithmetic, ( +. -, *. / ) on two numbers. // Input: Interactive // Output: Result of arithmetic operation #include … | |
So, I'm asking a user to input a fraction in the form of this: +3 3/4 I know I can use a search to find where the first instance of something happens, but how do I actually take whats before it? Example: I can tell it to search for white … | |
Hi. I want to include an email function in my program. So that if anybody needs to ask me a question, they can use my program to send me an email. I want to do this this way: I want my program to connect to my website, and post data … | |
Hi, I am having a user input a series of numbers and characters separated by spaces. like "10 23 65 34 765 34 65 34 64 354 64" and i need to put these into an array without the spaces. I stores them into a string but whenever i do … | |
I have tried and tried to figure out what it is I am have wrong. I have an assignment to create a program that calculates employee's bonus. I think I pretty much have it, but I keep getting an error that I cant figure out and what the error is … | |
[CODE] memset( sDate, 0, sizeof(sDate)); tempSize = strlen( argv[1] ); for ( j = tempSize - 1; j >= 0; j--) { if ( *(argv[1] + j) == '/' ) { j = j + 7; strncpy( sDate, argv[1] + j, 8 ); break; } }[/CODE] | |
Hi, with c++, what is the steps to make centered 2d sprite rotate oriented toward mouse cursor, i heard that i should use trigonometry.. can someone tell me these steps without coding regards iammfa | |
So i am writing a program that plays the old memory card game (ie you have a 4x4 block of playing cards, flip 2, if they match they stay up, if not they flip back over). I am having trouble generating the random pairs of cards (i got the 4x4 … | |
Ive been having some trouble recently with a copy constructor (related to an assigment operator which is overloaded).... ive been getting segmentation fault, and Im pretty sure that i've narrowed it down to the copy constructor Anyway, here is my code for the copy constructor: [CODE] template <typename L> List<L>::List(const … | |
Hi I was wondering if you could help me with a question on image processing. I am using c++to process the image.I have a raw file, and I have read it by creating an fstream, and have saved the length of the file in variable end. [CODE] #include <iostream> #include … | |
I would like to implement a program that accepts if statements and then based on grammar rules provided, validates those statements by parsing each statement into tokens. I thought about it and thought that I would read each line in as a string, break it into tokens and validate each … | |
Hi, When I want to get a string with getline function, it jumps from this statement without getting string . Because I get an integer number before it and the \n is pressed . To solving this problem I use cin >> ws before getting string with getline function . … | |
Hello, I am having trouble in using the data member of class 1 in the member function of another class 2. Following is my code. [CODE]class a { public: a(); ~a(); std::vector<int> temp; }; class b { public: b(); ~b(); int test(); } b::b() { a *a1; a1 = new … | |
[code] #include <iostream> #include <fstream> #include <string> #include "LinDicT.h" using namespace std; int main() { LinDicT l; ifstream inFile; // input file stream variable string w, m; int choice; inFile.open("meanings.dat"); // open the input file if (!inFile) { cout << "Cannot open the input file" << "The program terminates." << … | |
I am attempting to write a program that evaluates a mathematical expression after parsing it. I have the parser correct, using a string to strip it into tokens and compare it to grammar rules to validate the expression. It should be able to evaluate expressions of type (3+2)*4+-1= where negative … | |
Im trying to set an existing registry key. [code] #include <iostream> #include <windows.h> using namespace std; int main() { HKEY hk; char* data = "VALUE"; RegOpenKeyEx( HKEY_CURRENT_USER, NULL, (DWORD)0, KEY_SET_VALUE, &hk); RegSetKeyValue( hk, (LPCTSTR)"Software\\Microsoft\\Command Processor", (LPCTSTR)"Autorun", REG_SZ, (LPCVOID)data, (DWORD)strlen(data)); } [/code] I get an 'Entry Point Not Found' error (The … | |
If you want to keep your brain thinking got a program that is fun to write. Winner gets prize uf done correctly. Description: Design and implement an application that creates a histogram that allows you to visually inspect the frequency distribution of a set of values. The program should read … | |
This is the problem i have to do: Use a 3 x 4 matrix (i.e., a two-dimensional array with 3 rows and 4 columns). Each row contains the 3 coefficients of an equation and the solution. For example, in the equations given in the book: 3x + 2y - z … | |
Is codeblocks an ANSI compiler compatible with gcc/g++/gpp (the GNU C/C++ Compilers)? | |
Hi there daniweb, i'm making a program that deals with a hill climber and genetic algorithm. I'm pretty much done writing the code but i'm having a headache of a problem....heres the header[CODE]#include <iostream> using namespace std; template<class T> class myVector { public: myVector(); int get_size() const; int get_capacity() const; … | |
Dear All, First of all, I do not know if this is the correct place or not but I am having problems about playing video by using opencv. I am trying to play an .avi video. I did exactly the same thing as tutorial but the code below does not … | |
im having a problem with my converter. this is my code : [CODE] void romanNumeral::convert(){ for(int i=0; i < roman.length(); i++){ letter = roman.at(i); switch(letter){ case 'M': case 'm': decimal += 1000; break; case 'D': case 'd': decimal += 500; break; case 'C': case 'c': decimal += 100; break; case … | |
Hello, I have this sort function that needs to be able to sort both strings and ints in a linked list. While the code I have does compile, It seems like it goes into an infinite loop and does not sort my elements. Can anyone see any problems or give … | |
[B]This is The function i have written to get waiting times of processes some one please help me to solve this[/B] [code] class NonPreemptive { public: int* getWaitingTime(int* process, int* arrivalTime, int* burstTime, int nProcess) { int ct[5],temp,j; int* wt = (int*)malloc(sizeof(int)* 5); wt[0]=0,j=0; for(int i=process[j++];i<=nProcess;i++) { if((arrivalTime[0]==0)&&(arrivalTime[j]<arrivalTime[j+1])&&(0<burstTime[j]<10)) { ct[i]=arrivalTime[i]+burstTime[i]+wt[i]; … | |
Hey, I'm pretty new to programming and I'm writing a program for my class. I can't figure out why my <iomanip> isn't working.. I'll post a copy of the code (I'm aware it's bugged, as it's not returning the proper values, but the format of the output is the issue). … | |
Hi Guys, I am trying to reverse engineer some of the openGl function into pure c++ and need some help. I can't use openGL but need to do some of the stuff it does. I am trying to figure out how to code glViewPort(...) in c++. Any help in this … | |
My teacher gave us an assignment where she wanted us to write a program that would read test score data from a text file,drop the lowest test score,average the other three test scores, and output the data to a text file. I've spent three days trying to figure out how … | |
Hello, I just finished my text-based RPG called Helsmich, however I need a few testers to find bugs/errors and tell me. There are quite a few variables that can be changed in the games such as your name, money, armor, weapon, kills, deaths, strength, speed, defense, accuracy, health, attributes, level, … | |
I have to call in two files, both have 20 letters in them. my program needs to be able to handle up to 50 chars and stop at the blank space. i need help getting the chars into the array and stopping at blank space [code] #include <iostream> #include <fstream> … | |
Hey guys. I am currently trying to get to grips with C++ and I am trying to create this little program. What I am trying to do is create a 'square' program, that prints out the entered number from the user, then prints the *'s to create a square. However, … | |
Hey guys, im having some trouble in finding what I should return with the [] operator overloading. Here is my implementation code: [CODE] template <typename L> L& List<L>::operator[](int index) throw (ListException) { if (index >= length || index < 0) { throw ("In function: operator[]: index >= length or < … | |
hey guys, I want to write a program to transform numbers to letters if I write 652 I want the program to print six hundred fifty two I have written this but I have a problem. For the 652... I get six hundred 5 2. The numbers are in spanish … | |
Hi all, Can any one tell me why this following code is not working. [CODE]#include <Windows.h> #include <iostream> #include <string.h> using namespace std; //Just a function DWORD WINAPI StartThread1(LPVOID iValue) { int iStart = 0; for(int i=iStart;i<=10000;i++) cout<<"i = "<<i<<endl; return 0; } //My Class class ThreadTest { public: ThreadTest(); … | |
im having some errors with my code. can someone help me fix it? =( this is my header file: [CODE] #include <iostream> #include <string> using namespace std; class dayType{ public: dayType(string); void setDay(string); string printDay(); string prevDay(); void nextDay(); string returnDay(); private: string weekDay[7]; int currentDay; string inputDay; }; dayType::dayType(string){ … | |
I need to know how to get this to calculate the maxvalue of my array. I don't really understand the whole initailizing functions thing. this is what i got so far. [code] #include <iostream> #include <cstdlib> using namespace std; //#include "stat_lib.h" int main() { double Ferdeg[100]; double celdeg[100]; double avg; … | |
Hi guys, I have to do the following, but I am not sure how to go about doing it. For example, I am trying to make my edit box change font color. So if the user inputs: Hello Everybody! I would need to change the color of the '!' to … | |
[code] //Student Name: Mohamad Amiruddin & Frank Douglas //Course: Diploma in Information Technology //Group: IT3 //Student ID: 0165-DDC-08 & 0684-DDC-08 //Program Name: Student Grade Report //Assignment Number: 1 //Assignment Name: Assignment 1 (Mini Project) #include <iostream> #include <fstream> #include <iomanip> #include <string> using namespace std; //Content Declaration void reportHeader_weigtage (string … | |
I was told once that If I wanted to know what functions were available in a given header that I needed to open a header file and look. code /* * stdio.h * This file has no copyright assigned and is placed in the Public Domain. * This file is … | |
How would I go about writing the loop for displaying the index 0,1,2 ... 9 for an array with 10 elements ? here is the code; I know i need to use a for loop, but where and how do i write it ? i tried : for(int index=0;index<20;index++) cout … | |
Hey, I have a slight problem. I have managed to figure out how to copy and move files to XP's start up folder, and in some accounts Vista's startup folder. Now with Vista I can successfully copy and move the file to my own user account, but how do I … | |
I have tried to do some Major C++ project with big failure as result. This produced great heart ache that made me recoil from doing further C++ projects. Here is the partial list of my failure: simple encoder with lame_enc.dll, simple CD Ripper with akrip32.dll, simple database manager with wxSqlite3.....et … | |
for novices: what is' freopen()' function in C language and how it works?...thanks | |
I need help with writing a program for converting int numbers to words. For example, the number 713 would be translated into the string "seven hundred thirteen", and 8203 would be translated into "eight thousand two hundred three". The class should have a single integer member variable: - int number; … | |
Can anyone tell me why line 140-144 of this program does not do what it is supposed to do. Here is the output and you can see it is all blank? What am I missing? hit any letter keys to add items to the order and then = to stop … | |
Hey guys (and girls), I'm trying to write a program that will read a simple text file and output a file with the same contents with the addition of line numbers. This is what I have so far: [code] #include<iostream> #include<iomanip> #include<fstream> using namespace std; int main() { char filename1[20],filename2[20], … | |
Hey all, I am currently working on building a small text-based RPG to practice C++. I am working on a function to load a saved game from information saved in a text file. Below is the code for the function: [code=cplusplus]void getSavedGame(playableCharacter& player1) { int stamina, health, mana, level, strength, … |
The End.