49,761 Topics
| |
//Enter phone number: 1-800-COL-LECT //1-800-265-5328 Im trying to input the dash right after COL and before LECT. Please help [CODE]#include <stdio.h> #include <stdlib.h> #include <math.h> int main() { char ch; printf("Enter Phrase\n"); while((ch=getchar())!='\n') { if ((ch=='1')) printf("1-800-"); else if((ch=='A')||(ch=='B')||(ch=='C')) printf("2"); else if ((ch=='D')||(ch=='E')||(ch=='F')) printf("3"); else if ((ch=='G')||(ch=='H')||(ch=='I')) printf("4"); else if … | |
Hello, im currently using this kind of Hotkey : [CODE] if(GetAsyncKeyState(VK_F1)) { if (this->checkBox1->Checked == false) { this->checkBox1->Checked = true; } else { this->checkBox1->Checked = false; } }[/CODE] But its not very good. I couldn't find a better way to do this :/ (im using Visual Studio 2008) Anybody knows … | |
ok so for some reason its telling me my "else" has no matching "if" in line 51, i have to make it so the binary output is spaced which im pretty sure i did and has to have a separate output if the character length is more than 8 [CODE]#include<iostream> … | |
[CODE] #include<iostream> using namespace std; char* Invert(char* input,int start,int end); char* reversewords(char* current); int main(){ char inputstr[] = "London is a city"; cout << "Inverted string : " << Invert(inputstr,0,strlen(inputstr)) << endl; int start,end ,i; while(*inputstr){ if (*inputstr == ' ' || *inputstr == '\0') { Invert(inputstr,start,end); start = i+1; … | |
Hey everyone, I'm new to the site, this site returned the most results when trying to look for relevant information so here i am. I have seen people write questions to assignments on here without trying expecting people to answer the assignment question. And ive also seen people steal code … | |
Hey guys I am a noob when it comes to this stuff. I go to college for electrical engineering and me and my professor were discussing a cool senior project. There are regular vending machines in most buildings of the school that are connected to the schools network. The ethernet … | |
I've download this following program source from a SVN repository.. [url]http://blanddns.no-ip.org:81/repos/public-smart/[/url] How do I compile it?? I've tried but it has c++ and java files included in it.. and some are even in separate folders. Can someone tell me how? Do I have to do command line? Do I need … | |
I don't understand what I am doing wrong here. I am trying to quickly write this program so that I can use it to test a flowchart diagram that I made earlier. When the output comes up on the console "Enter a course name" and I put any input in … | |
I am learning c++ now and have encountered a problem in trying to create single digit addition, multiplication and subtraction math questions. The numbers used in the questions are randomly generated from 1 to 9 and when I try to print the answer for the corresponding question, I get a … | |
Dear friends: I have a sparce matrix , and i want to write the matrix pattern to a postscripte file. Could you please told me how to write a postscripte file with c++ . Regards | |
So i'm making this periodic table kinda program here mainly outta boredom. But I came across a problem, when I type in the name for the element, the program just closes. Any ideas on how to get it to work properly. Here's my current code. [CODE]#include <iostream> #include <windows.h> #include … | |
[CODE]#define WIN32_LBAN_AND_MBAN #include <windows.h> LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { WNDCLASSEX windowClass; ZeroMemory(&windowClass, sizeof(WNDCLASSEX)); windowClass.cbSize = sizeof(WNDCLASSEX); windowClass.style = CS_HREDRAW | CS_VREDRAW; windowClass.lpfnWndProc = (WNDPROC)WindowProc; windowClass.hInstance = hInstance; windowClass.hCursor = LoadCursor(NULL, IDC_ARROW); windowClass.hbrBackground = (HBRUSH)COLOR_WINDOW; … | |
I don't understand how it works. What are lines 19-33 doing exactly? Why did they do "arraySize = obj.arraySize;" ? [CODE]#include <iostream> #include <iomanip> using namespace std; class NumberArray { private: double *aPtr; int arraySize; public: NumberArray(NumberArray &); NumberArray(int size, double value); ~NumberArray() { if (arraySize > 0) delete [] … | |
Hi! I am supposed to only use the "procedural fragment of C++", i.e. no object-oriented programming (like cin, cout etc). Vectors are not allowed either. So, one of my goals is to count the number of lines in a text file (let's call it train1.in) which contains data like: [ICODE] … | |
Dear friends: I download a Matrix library "MET" from [url]http://met.sourceforge.net/[/url]. I want to compile it under windows system. I download the MinGw. when i excute the following command, it give the me the following errors: [CODE]G:\met>make g++ -Icommon -o xpr1Test xpr1Test.C -lm In file included from vecmat.h:35:0, from xpr1Test.C:6: xpr1.h:31:22: … | |
the letter e is the most frequently used letter in the english language, and the letter z is the lease used. a friend of yours doing a blah blah believes that this may not be necessarily be true of writings of first year college students. to test his theory, he … | |
Hi i am trying to write a program where the user inputs a list of space separated words (more than ten are required); the program then reverses and prints the order of the words. Example: input:“Extra Credit Programs”; output: “Programs Credit Extra” but my program s far is not behaving … | |
The issue is that it doesn't seem as though the code isn't getting past the 3rd if-else statement, and even if the input is correct it will say invalid times and set the values to 0. I can't tell what the problem is. [CODE]#include <iostream> #include <string> using namespace std; … | |
i created a new project, added some textboxes and labels with one button. when i built the project the first time, i just got the error: general error c101008d: Failed to write the updated manifest to the resource of file "..\Debug\Login.exe". Access is denied. mt.exe Login someone help me please! | |
Hi, what does this error mean? : error C2440: 'initializing' : cannot convert from 'char' to 'const char *' i'm trying to read an image from a file using this code: [COLOR="Green"]#include "itkImage.h" #include "itkImageFileReader.h" int main( int , char * argv) { typedef unsigned char PixelType; const unsigned int … | |
Hye..i dont know how to output the position for array. [QUOTE] Enter value for array A(4x5): 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 Enter value for array B(4x5): 1 2 3 4 5 1 2 3 4 … | |
hi I m new here and not sure about how things go about... but could any one tell me about collaborations of objects in c++ | |
I'd like to know: 1.) On line of code which says: "Production possibleExpansion(infile);", what is the nature of possibleExpansion(infile)? Is it a function? Is it an object of class Production? 2.) On line of code which says: "possibleExpansions.push_back(possibleExpansion);", what is the meaning of it? [CODE]#include "definition.h" #include "random.h" Definition::Definition(ifstream& infile) … | |
The CashAndCreditShop supermarket determines the retail price of a product based on the time it is expected to stay on the shelf. Any item that is expected to sell in one week or less is marked up 10%, and any item that is expected to stay on the shelf for … | |
I'm running a structural analysis program in VS2010 which iterates through a loop up to 4000 times. The program keeps breaking on me around the 960th loop and gives the following error Unhandled exception at 0x0040cd1d in Structural Analysis Program.exe: 0xC000005: Access violation writing location 0x00000000. The error seems to … | |
I have made a header file with a templated dynamic array class that I wish to convert into secure code. The problem is that since all of the code relies on the Template I cannot put it into a static library. Any ideas how I could still make the source … | |
Need help converting from hex to binary any help is very appreciated!! [CODE]#include <string> #include <iostream> class Hex { private: //constructor std::string hexNumber; int decNumber; public: Hex(std::string hNum): hexNumber(hNum) {} Hex(int dNum): decNumber(dNum) {} ~Hex(); int toInt(); std::string toBin(); std::string toHex(); }; [/CODE] it keeps saying i need to put … | |
Hey everyone.. I need some help writing code for c++ to make a plot. I think im suppose to use an array but im lost after that. The plots are suppose to look like the pictures in the link and the points come from a data file that im reading … | |
[CODE]#include <iostream> using namespace std; int main() { double firstNo;// first number is stored here double secondNo; double result;//variable for result when first and second number are operated upon char operation;// place to store the user's inputed operation // asks the user to choose the first number cout<< "Enter in … | |
I'm looking for the best way to make a method available to a sub class (not talking inheritance, polymorphism at all, just standalone classes!) without handing down a million pointers to each sub class. [code] Class A; // contains many instances of other classes. Class Z; // one of those … |
The End.