49,761 Topics
| |
I have been looking around the internet all day looking for a way to stop my program from entering an infinite loop when the user enters anything except a number when I cin an int. For example: [CODE] while(blah blah) { int x; cin >> x; if(x == 4) break; … | |
I have errors for the template can any1 see anything wrong??? //Array.h [CODE]//Header file for Array.cpp. class Array { private: //Template for use with the Array's data type. //Member Variables. int size; int grow_size; int num_elements; public: //Functions. template<class Datatype> int m_size; Datatype* m_array; //Consturctor. Array( int p_size) { m_array= … | |
i have a text file "test.txt" with "This is a secret file" in it. I want to read in the whole sentence in with white spaces and manipulate each character. How can i do this? My current method leaves out white spaces. [CODE]const int SIZE = 17; char string2[SIZE]; ifstream … | |
Attached is my code for my homework for my C++ class. My problem comes from when I run the program. It returns a value of 1 every single time for the output of the "is it a leap year or not" part of my program. Then, when it outputs the … | |
Ok, The problem is that when I execute this program (C++) what ever numbers I put into the answer slot it is given me the answer to the numbers of what ever I choose whether it would be Add, Subtract, Multiply or Divide as a Sum and not Difference or … | |
I am trying to complete an assignment, but first need to get the program to run. I get a debug error, "numberArray being used without being initialized. Am I'm missing something? I am using three functions. one to get the highest number in an array, second to get the lowest … | |
Hello can anyone help me with sorting this struct by name and surname? Ive done like this and it doesn't sort it. Thanks Code: [CODE]#include <iostream> #include <string> #include <vector> using namespace std; struct student { int st_studenta; string vpisna; string ime; string priimek; }; student vpis(int st_studenta) { student … | |
Write a program that finds the factorial value of a given number as shown. Display an appropriate error message if the number entered is negative, or too big for the answer to be correctly calculated. Enter a non-negative integer : 5 5 x 4 x 3 x 2 x 1 … | |
Hello! Im having trouble with reversing string in this program: [CODE]#include <iostream> #include <string> using namespace std; int numChars(string besedilo[]) { int znaki=0; int vrstica=0; for(int a=0;a<10;a++) { vrstica=besedilo[a].length(); znaki=znaki+vrstica; } return znaki; } int numWords(string besedilo[]) { int besede=0; string vrsta; for(int a=0;a<1;a++) { vrsta=besedilo[a]; for(int b=0;b<besedilo[a].length();b++) { if(vrsta[b]==' … | |
Hi everyone, I'm a moderate-level C++ programmer who is a little rusty at the moment. I've got an object question which is driving me nuts. I'm sure this is a C++ 101 level question, but for the life of me, I can't recall the solution. Basically, I've got one object … | |
I have a simple query, I am using code for "QUEUE IMPLEMENTATION USING SINGLE LINKED LIST" [url]http://ds4beginners.wordpress.com/2006/12/17/queue-implementation-using-single-linked-list/[/url] for my program but having an issue if you pleas help me. [CODE]public class queue { gcroot<message^> msg; queue* next; public: queue(); queue* enqueue(queue*,message^); queue* dequeue(queue*); void queue_display(queue*); void setbinding(String^); String^ getbinding(void); }object, … | |
I saw the movie from the link[URL="http://channel9.msdn.com/Events/GoingNative/GoingNative-2012/Keynote-Bjarne-Stroustrup-Cpp11-Style"]http://channel9.msdn.com/Events/GoingNative/GoingNative-2012/Keynote-Bjarne-Stroustrup-Cpp11-Style[/URL] Could I find something like std::async from boost?Thanks a lot | |
Recently I made a little program that could open files/exes/links. (facebook, vs 2012, ect ect) But it was in the command prompt. Worked perfect. I decided to make a forms application to do just the same, except through buttons instead of user input. But I keep running across this problem... … | |
hey, today my teacher told us to use pipe and fork to write a program without teaching us anyway... if any would recommend some good tutorials would be great~!! and what does fork a child mean really mean(example would be great), and how write to a pipe? everything is done … | |
Hello everyone, i am a current PHP programmer. I am wanting to start C++, is there any good websites i could start to learn? Or is there any tips for programming with C++? Also what is C++, what is it used fore etc.. Thanks, Marais | |
I am creating a view in the dialog. when i am instantiating the dialog like this CMyDialog dlg(NULL, L"filename.txt"); dlg.DoModal(); CMyDialog constructor I overloaded so that it takes a file name. Now in the OnInitDialog() function I an intializing the view pointer m_pView and creating the view, toolbar , everything. … | |
How we Comparing the text in the edit box and the tree item in Visual c++ Mfc | |
What is the best way to change the following program into functions? Can someone show me as a good programming style? [CODE] #include <iostream> #include <string> #include <ctime> using namespace std; // Variables char R, playing, again; int roll, roll1, roll2, roll3, round, money, wager, win, loss, initial; string name; … | |
header1.h [CODE] #include <iostream> #include <string> #include <cmath> #include <math.h> #include <algorithm> #include <Windows.h> #include <conio.h> using namespace std; int gotoxy_object(int x, int y) // your object { HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); COORD point; point.X = x-1; point.Y = y-1; SetConsoleCursorPosition(hConsole, point); return SetConsoleCursorPosition(hConsole, point); } int gotoxy1(int x, int … | |
First question here, so bear with me. I have been trying to create a view on a QMainWindow using a QDeclarativeView as the canvas, but whenever I try to switch the source of the QDeclarativeView my program segfaults and I frankly have no idea why, or how to fix it. … | |
I am using CodeBlocks IDE with Digital Mars compiler, although my program is compiling and there are no errors, when I try to build my program, i get this error and the program isn't running. [CODE]OPTLINK (R) for Win32 Release 8.00.5 Copyright (C) Digital Mars 1989-2009 All rights reserved. http://www.digitalmars.com/ctg/optlink.html … | |
If we write some text in edit box which already contained in tree control in mfc when we click the button its remove from tree control .Plz tell me in visual c++ mfc plz fast replt . THANKS IN ADVANCE | |
I have an integer called: int pID = 0; Inside my while loop I'm using pID++; to increment it. Sometimes the pID doesn't get incremented and sometimes it will. My sample output would be. 0 1 2 2 2 3 4 5 5 6 7 Does anyone have an idea … | |
I want to change chars in string like this: if i input DaniWeb it will change it to EbojZfc I've come so far: But this changes to z at the end :S Please any help... [CODE]#include <iostream> #include <string> #include <algorithm> using namespace std; int numChars(string besedilo); int numWords(string besedilo); … | |
Could I find some translator which could translate partial C++ codes to equivalent C codes? like [code] int max(int A, int B); double max(double B, double B); [/code] would be translate to something like [code] int maxInt(int A, int B); double maxDouble(double B, double B); [/code] [code] template<typename T = … | |
The following errors popped up upon compiling is there a way to fix this in dev c++ ??? Please resond here or to <snip> Thank you. \Dev-Cpp\lib\gcc\mingw32\3.4.2\include\syslimits.h [Warning] #include_next is a GCC extension <- I have mingw installed from the included updater in dev c++ C:\Dev-Cpp\include\sys\types.h ISO C++ does not … | |
i want 128 bit key in my academic project. Can any one please tell me how to generate 128 bit key in c++. | |
You are to write a program that will allow Apollo College to maintain the marks and grades of its students in a programming class. Assume there are ten students in the class. Your program will need to store the following information for each of the students: 1. Student’s name, to … | |
Hi all! Quick summary: I'm attempting to shutdown a socket, but the framework that I'm inheriting an Interface from already contains an implementation of a "shutdown" method. Therefore, I am unable to call "shutdown" for the socket. Longer Explanation: How can I fix this? I originally tried looking for a … | |
could any one help me on SDL_GetMouseState(0,0)........ my coding is as below [CODE] if(SDL_GetMouseState(0,0)&SDL_BUTTON(SDL_BUTTON_LEFT)) { //function calls } [/CODE] this coding works button when i click on the window the contents remain only till the button is in pressed state........ |
The End.