49,756 Topics
![]() | |
Hi Im not sure if this question belongs in the form so sorry if it doesn't. Here is my question, in a cs class of mine we have to write a make file that compiles the two seperate programs in the project. The only problem is that none of the … | |
For instance... say that I set char a = 'a' char b = 'b' how would I combine them to make them "ab" using strcat? | |
i need help with how can i begin with 3d programming please help me | |
This is an assignment from school, I have spent a week bashing my head against the wall atrying to figure out how to get this to work. The program reads in a 'maze' or X's and stuff from, a file, and my functions are to fill a pre diminshied char** … | |
Hello everyone! I am building a mfc dialog based application in visual c++ 6 and using mysql c api to connect to a database. What i need is a simple type of data grid to show mysql query results in a dialog. I do not need to edit, update, save … | |
Hi Everyone, I'm trying to interpret some data from an embedded sensor device into a C++ program. The device uses a numerical format called 1.15 fractional format. This means it transmits 2 hex bytes into a value rangle of ~1 < n < -1. A full description of the format … | |
How do I combine two c-style strings together? Basically I'm trying to see if the first letter is in the dictionary... then if it is.. check if the first and second letter are in the dictionary.. and if it is... check if the first, second, and third letter are in … | |
void main() { cout<<"Can somebody fix this?"; } hi, i'm new to C++ programming. that was my code... i'm using Turbo C++. It's showing so many errors!.. I don't know what to do. Please help!! the errors are listed as follows: Compilong XYZ.CPP Error XYZ.CPP 1: Unable to open include … | |
#include <iostream> #include <fstream> #include <string> using namespace std; const int numRows=5; const int numCol=7; void openfile(ifstream& , ofstream& ); void initialize(ifstream& , ofstream& ); void ave(ifstream& ,ofstream& , double , double,string ); void printout(ifstream& , ofstream& ,string ,double ,double ); int main(){ ifstream infile; ofstream outfile; string names[numRows]; double … | |
Hi.. can anyone tell me what is the meaning of this error?? [Error] cannot convert 'std::string {aka std::basic_string<char>}' to 'char*' for argument '1' to 'char* strcpy(char*, const char*)' When I'm taking TeamName as char TeamName[30]; , the compiler shows linker error. what could be the problem? I use DEV C++ … | |
For instance, shouldn't the following code work if I wanted to pass an element of a 2d array? if not what would be the best way to do it? Thank you! #include <iostream> using namespace std; void randomProgram(char random[][]){ random code inside of here; } int main(){ char letters[6][6] = … | |
I am working on this project and i am going to need to write information and retrieve them from a file. I get all the information needed but i am not sure how to write it to a file and how to get it back. if (id.is_open()) { cout<<endl; cout<<"Enter … | |
For an assignment for class i wrote this code right but the only problem i have is that i can't get the right value that assignment wants which is distance so far: 0 meters distance so far: 1000 meters distance so far: 0 meters distance so far: 0 meters distance … | |
i wrote this code for sending and recieve mail but i can't get the output that is required for class which is -Test 1-- Creating a new envelope Addressing from Muffin To Howie Inserting the message: Pet me! Affix Postage: 0.33 stamp Sealing the envelope Mailing the envelope --Test 2-- … | |
Anyone has idea to seperate a word in parts for example ( kalemimin -> kalem-i-min ) 'kalem' is str1 , 'i' in str2 and 'min' should be get into str3. | |
`Inline Code Example Here` I have been trying to solve this but i just can't get it right... can someone help me pls? Using array to summarize survey results 40 Students were asked to rate the quality of the food in the student cafeteria on a scale of 1 to … | |
I'm trying to build libpng which has worked up to a point. I'm using Windows XP, and have a MingW compiler. I also have MSYS installed and am using it to configure libpng. The issue I'm having is that libpng can't find zlib. I've tried every variation under the sun … | |
Hello, My friend and I were done with our work in math class, and threw together this little text-based rpg in like ten minutes. Anyway, we're having a small issue, everytime I press the "2" for "Fight!" the loop regenerates the random values and we mysteriously gain health that was … | |
Hello, I am writing a program that reads in data from a text file and puts it into a linked list. Certain variables are read in only if the "officeHeld" number is a particular number, otherwise the variable is set to 0. When I run this through Visual Studio, I … | |
#include <iostream> #include <iomanip> #include <string> using namespace std; void getInput (double& currentPrice, double& prevYrPrice, double& twoYrAgoPrice); void calculateInflation (double currentPrice, double prevYrPrice, double twoYrAgoPrice, double & currentInflation,double & preInflation); void printOutput (double currentInflation, double prevInflation); int maine () void getInput (double& currentPrice, double& prevYrPrice, double& twoYrAgoPrice); { cout << … | |
Define a function drawRectangle with the following prototype: void drawRectangle(int width, int height, int offest); The function will print a rectangle made out of height rows with '@' character repeated width times on each row. The first @ on each row will be preceded by offset spaces. That means the … | |
Alright, so I need some more help. This time, the problem is not inherently in the code (Though I've had trouble with that thus far too). I am currently playing around with open and close file dialogs trying to get what seems to be an out-dated "GetOpenFileName()" function to work. … | |
I have Visual Studio 2012 Ultimate. I tried creating a Win32 Program and there are no debugging errors. However, when I debug it, the window I am creating should be shown on screen, but there is no window. All I see is my code. Why would this happen? #include <Windows.h> … | |
I wrote a program to simulate a simple page flip animation in opengl and now i'm trying to replicate it with two images using texture mapping so that the second image appears on the "back" of the first image during the drag of the lower left corner of the page. … | |
For a program i'm writing I need to read a .txt file into a 2-d array. The txt file contains spaces that need to also be read into the array, so I was told I need to use getline, but after searching google and this site i'm not sure exactly … | |
Hi I am setting the sampler states initially then setting them on the fly with keypresses that I know runs but I dont see anything changing. Am I missing something. Can I just call SetSamplerState(...) anytime or do I need to call something after? static bool bToggleH = false; static … | |
Good Morning, I just want to know how to implement a body initilization in a class. Below is the class information. class A { private: const int size; //a const data member char *cat; public: A(); //default constructor A(const int n); //constrcutor with parameter void print(); //print A ~A(){delete[] cat;}; … | |
Hi I was just looking up the difference between cin.get() and cin.getline(). It seems they can both function the same way except cin.get() keeps the delimiter in the buffer while cin.getline() throws it out. My question is with this code: char name[200]; char name1[200]; char name2[200]; string hi; cin >> … | |
Hi, In the program below, in the cout statement I want to understand what the code in the (ptr –arr) is doing. I understand ptr is the result of the find algorithm but I don’t know what the –arr does. If you can explain that to me I would appreciate … |
The End.