49,761 Topics
| |
So, I have to store ( in a variable?) the number as a Roman Numeral ( M = 1000, D=500 etc.) Convert it to decimal and store in decimal. Print the number as a Roman numeral or decimal number as requested by the user. I suppose it's 2 separate functions, … | |
I thought about something like this. Is this a good way to do it ? [code] std::stringstream Num; std::string str; Num << 5; str = Num.str(); [/code] I have this: [code] int ist = 5; [/code] How is it possible to convert ist to std::string ? | |
Hello I'm not too experience with c++ but I've learned some of the basics. I tried making a small txt file encryption program however my output prints one too many times to the 2nd txt file. This occurs both when encrypting and decrypting. [CODE] #include <iostream> #include <fstream> #include <cstdlib> … | |
This is the second piece of code I have ever written don't seem to understand what I'm doing wrong. It seems to be going over my head as I have no prior knowledge of any programming language and have literally just begun. I have tried searching the issue to resolve … | |
Hello programmers out there again :) Im using this code (Thanks to adatapost): [CODE] private: System::Void textBox1_KeyPress(System::Object^sender,System::Windows::Forms::KeyPressEventArgs^ e) { if(Char::IsDigit(e->KeyChar)) return; if(e->KeyChar=='\b') return; if(e->KeyChar=='-') return; e->Handled=true; }[/CODE] To allows only digits, backspace and "-" But the problem is that you can put the "-" anywhere and as often as you … | |
I need to know how to work this out, say for example i have a method is C++ that is helloworld(), and i need to call it from a C program. [CODE] // in my C++ program void helloWorld(){ // some code; cout<<"hello world"; some code..... }[/CODE] [CODE]This is my … | |
Hello friends.Can anyone help me in this.Here is the code. [CODE]circle(320,240,100); textmode(BW40); cout<<"\n\n\n\n\n\n\n\n\n\n\t\thello";[/CODE] The problem is hello is displayed without circle. | |
So I am new to maps, vectors too, but I read a guide on those. And I need to do one thing with the map that I haven't figured out yet. Implement this C# code into C++ [CODE]map.TryGetValue(oldValue, out newValue)[/CODE] In the C# code map is a dictionary, so I … | |
Hi Just written a small C++ program to try the Public & Private Key Algorithm process, the program seems to function properly as intended in that it decrypts a message sent from Bob using Alice's Public key. [CODE]#include <iostream> using namespace std; /*********************************************************** XOR Process for both encryption/decryption processing ***********************************************************/ … | |
Hello I am working on this program and I cannot seem to get it working. I am trying to get an input of a line using cin.getline() but i am unable to get that line and assign it into an array of characters. Everything compiles correctly but the alphabet[50]'s output … | |
Hello: I am trying to create an audio processor, and I have a program that creates some threads (in Windows). The "main" program creates the audio processor thread, and then creates the audio reader thread. I would like to know how the audio reader can tell the processor that the … | |
Can u guys help me to find errors of this programme! [CODE] #include<iostream> #include<conio> #include<string> using namespace std; string employeeName; int employeeNumber; double employeeSalary; char employeeType; class Employee{ private: string employeeName; int employeeNumber; double employeeSalary; string employeeType; public: void promotion(){ calc_salary('pr'); } void demotion(){ calc_salary('de'); } void calc_salary(char ch){ float … | |
Hello programmers out there :) Im currently having problems with allowing the "-" in my TextBox. [B](Im using Visual Studio 2010)[/B] Im kinda new to programming, thats why this code looks messy. [CODE]void Form1::textBox9_KeyPress(System::Object^ sender, System::Windows::Forms::KeyPressEventArgs^ e) { if(!Char::IsDigit(e->KeyChar) && (e->KeyChar != 0x08) && (e->KeyChar != 0x6D)) e->Handled = true; … | |
hi!..i really need some help.. i need to print a pyramid pattern shown below in c++ language using a nested for loop... 1 1 2 1 1 2 4 2 1 1 2 4 8 4 2 1 1 2 4 8 16 8 4 2 1 1 2 4 … | |
hello, i want to write a simple university programme please first see my code [CODE]#include<iostream> #include<string> #include<vector> using namespace std; class subject { string code; public: void create_code(); void list_of_code(); }; class student { string name; public: void create_student(); void list_student(); }; int main() { int size_of_student,size_of_subject; student student_attributes; subject … | |
Hi, When I compile my class, I find a serious error C2558 no copy constructor available or copy constructor is declared 'explicit' My copy constructor is not private and not explicit ! I don't have any idea about this error Help me please. My class is : Cnoeud.h #include "Csequence.h" … | |
Hi, I have a problem, I dont know how to import data into a single array and then output it to the screen. I am quite new to c++ and would approciate your help. Here is information: When a vehicle has been manufactured, it has the following attributes: make (e.g. … | |
Hello! I am making a text-based game (I am new to C++) called The Final Journey (I made the name up, didn't copy) and I have had some trouble with the code. I am using Dev-C++ (I plan to get VC++), just so you know. Here is what I have … | |
Hello I am new to C++ and coding. A few years ago I decided to learn C++ and wanted to start off by making a text based game to start off. So I brought a few books and began reading and doing the tutorials for things like 'Hello World', 'Calculator', … | |
I'm currently developing a screensaver for Windows. I am curious as to how I can get my screensaver to display in the little screensaver selection window in the Control Panel under Personalization. Is it in the Registry or something? Or am I going to have to contact Mr. Bill himself … | |
What is the integer or double equivalent of the NULL character. That is, the integer that can be entered to represent NULL when using integers (supposing 0 is accepted as a valid integer and not a NULL). | |
[CODE]for(int i = 0; i < floorNum; i++){ if(floorNum == 12){ continue; { statements; statements; statements; }[/CODE] ------------------- if there anything wrong with this statement? i've tried using a while loop and the continue statement would work and skip number 12, but this doesn't work. | |
Hello, I have class named cTPS, there are 3 member functions called matrixP_2, matrixP_3 and matrixP_4 for calculating matrixP in three different ways. In constructor of this class I want to initialize a pointer declared in cTPS.h like this: [CODE]cMatrixBase *(cTPS::*matrixP)(void) //pointer MatrixP returning object cMatrixBase[/CODE] I initialize it for … | |
Hi im trying to loop through an input file such as: 333 45 56 67 456 80 90 74 ... First number is id, followed by three exam scores..and the "stud.h" is my struct for each piece of data. My problem is looping through each line of data. Any ideas … | |
The header file [code=c] #ifndef DRAUGHTS2_H #define DRAUGHTS2_H #include <SFML\Graphics.hpp> #include "TwoPlayerGame.h" #include <iostream> enum state{intro, playing, gameover}; //the states found within the game enum squareValue{green, red, blank}; //the draught square values on the board class Input { public: Input(); void setInput(unsigned int,unsigned int); unsigned int getX(); unsigned int getY(); … | |
Hello, I have created a C++ dll with some functions and structures.I need to access the structure in my C# program. When i searched the net, i found that there is no way to include header files in c#. What is the alternate way to use the structure definitions in … | |
Hi! I try to implement a matrix template class which inherits the vector of vectors. The message I get: "error C2679: binary '=' : no operator found which takes a right-hand operand of type 'const Vector<T> *' (or there is no acceptable conversion)" (When I call the alternate matrix constructor, … | |
Hi I'm learning C++ on my own here and am experiencing a problem with an introductory program I've created. My book provided me with a bit of code near the end to prevent my program from closing on me immediately, however it is closing on me as soon as I … | |
Good evening to everyone. I have some troubles with a task I have to do. I need some assistance. Excuse me if I haven't searched thoroughly in the forum and there is a similar topic somewhere. Thank you! [B]Here's the issue:[/B] Compute the minimal and the maximal value of function … | |
Hi, I got a problem in my winttp code which is connecting to the URL successfully but not able to POST the data to the the server, here is my main part of the code [CODE] hSession = WinHttpOpen(L"User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12", WINHTTP_ACCESS_TYPE_NO_PROXY, … |
The End.