49,757 Topics
| |
How to correct the output, because for the bold it follows every studentid. [code=C++] /*------------------------------ Programming to coutn the examids ------------------------------*/ #include <iostream> #include <fstream> #include <string> #include <algorithm> #include <vector> using namespace std; struct student { string studentid; vector <int> examcode; }; int main () { int mycount; { … | |
Please help this loop won't step out. It keeps asking for input 3 times even when the inputs are correct. [code] //login with loop #include <iostream.h> #include <stdlib.h> #include <stdio.h> // for gets int main() { char charname[15],charpassword[15],chartryname[10],chartrypassword[15]; int inttrys; cout<<"Please enter a user name to setup "; gets(charname); cout<<"Please … | |
Okay, so i need to enter a random number that is in centimeters, this will then be converted into Yards, Feet, and inches... all of these must be integers in the output and should look something along the lines of this. Example Output: 3 Yard(s) 20 Feet 6 Inches The … | |
I am fairly new to C++, as I began learning it two days ago, with some very basic background in java and python. I was trying to write a code that could simply store, recall, and delete entries in a class I named address_book. I did it first without using … | |
Ok, no matter what compiler i use, i can never find a compiler that will build/compile/run a single file like the one I have used in my school. i got Code::Blocks to compile my test file the code is short: // Test file [code=c++] include <iostream> int main() { cout … | |
to Anybody who know how to solve this problem.. I build my programming and I click the properties to open for a large windows for and save for permanently windows. But when I build it again, for the button c++ (blue colour) it missing and I cannot copy the output … | |
erm im trying to create a function to test if an array/matrix is symmetrical that is for example a[i,j] = a[j,i] i think i got the symmetrical test function correct....just that i dont know where to put that if-else statement. it just doesnt seem to fit anywhere in my codes. … | |
I am using a browserdialog to browse to a folder that I know contains .txt files. When pressing okay. I want all these .txt files to appear in my textFilesBox1. I have come up with this code that do put the path directory in the textBox1. I have searched for … | |
for this prob i have im supposed to cin a string of letters uppercased from A-H for example if i cin ABACDEFGH my prog should return them as such AA B C D E F G H however i came up with functions which are able to count the number … | |
What I need to do i something like this: [B]ClientData.h[/B] [code=c++] #ifndef CLIENTDATA_H #define CLIENTDATA_H #include <string> using std::string; class ClientData { public: ClientData(int = 0, string = "", string = "", double = 0.0); void SetAccountNumber(int); int GetAccountNumber() const; void SetLastName(string); string GetLastName() const; void SetFirstName (string); string GetFirstName() … | |
I am teaching myself C++. I am writing a lotto program to read in dates and numbers and update a file. This code snippet: [CODE]int numberset[6]; cout<<endl<<"now, enter the 6 numbers. Hit return between each number:"; for(int i=0;i!=6;i++){ cin>>numberset[i]; while(numberset[i]<1 || numberset[i]>53){ cout<<"the number is not a valid, lotto number! … | |
Hi I was wondering if someone could help with linked list. I'm trying to read i a text file in this format: ID Name PR Salary 339 GOERGE 4 26000 221 SANDY 4 22600 101 RONNY 3 35250 and put it in a linked list. I have this much so … | |
Hello, if I compile this code it crashes at the if statement comparison. Giving me an access violation. it is meant to check, wether the elements stored in the linked list are ascending. I would really appretiate help. Thanks stk123 #include <fstream.h> typedef char Item; class Node { public: Item … | |
I'm trying to make a shooting video game in conole mode but the game pauses to recieve an input from the key board. Ho can I get around this? How do game engines work? DFor exaple in a game like pac-man where the ghosts and other elements in the game … | |
I am getting this error when trying to complile the main program. the .cpp and the .h files compile fine, but not the main. Error 1 error LNK2028: unresolved token (0A00004A) "public: void __thiscall MyEmail::Createfile(void)" (?Createfile@MyEmail@@$$FQAEXXZ) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ) test.obj e-mail main code #include "stdafx.h" #include … | |
I have this assignment to do and i am confused on how to start this one. I am very new to programming and it would help me out a lot to see how someone with some programming skill would do this one. I learn more from observation so any input … | |
Hi, I'm trying to do a vector of stringstreams so i can edit/manipulate them using vector functions as i have already done using strings. everything was going fine using... [code] std::vector<std::stringstream> myVector [/code] However i'm getting the error "cannot access private member declared in class 'std::basic_ios<_Elem,_Traits>'" on this line... [code] … | |
i have a problem... i wanna make a function that takes a string as input splits it, storing the resulting strings in a vector<string> and then sort it [CODE] #include <iostream> #include <vector> #include <iterator> #include <sstream> using namespace std; vector<string> split( const string &sInput ) { istringstream is( sInput … | |
hi guys, is there any gui framework for c++ which is easy for beginners | |
[code] #include<iostream> using namespace std; void merge(int a[],int low,int mid,int high); void mergesort(int a[],int low, int high) { if(high>low){ int mid=(low+high)/2; mergesort(a,low,mid); mergesort(a,(mid+1),high); merge(a,low,mid,high); } } void merge(int a[],int low,int mid,int high){ int t[(high-low)+1]; int il=0; int ir=0; int nl = mid - low + 1; int nr = high … | |
for the colum and row, how to fill the space with examcode automatically, below, I must put one by one.. [code=C++] /*------------------- Two dimensional array -------------------*/ #include<iostream.h> #include<fstream.h> #include<iomanip.h> ifstream infile("STA83EXM.txt"); void main() { const int row = 139; const int column = 139; int matrix[row] [column]; //**************creates Matrix**************** int … | |
I am using GetFiles(string,string) to find .txt files in folders. The code that I am using look like this: [Code] folderBrowserDialog1->ShowDialog(); System::String ^ files3 = folderBrowserDialog1->SelectedPath; this->textBox1->Text = Directory.GetFiles(files3,"*.txt"); [/code] The compiler says that "Directory" is a undeclard identifier and left of .GetFiles must have class/struct/union. I am not sure … | |
alingment : [QUOTE]DOTS REPRESENT SPACES DESIRED OUTPUT Item................................................Price Burger..............................................100 pizza.............................................. ..50 patty................................................ 25 coke.............................................. ..10[/QUOTE] OUTPUT BY PROG. [code=c++] Item Price Burger 100 pizza 50 patty 25 coca-cola 10[/code] DISPLAY CODE [code=c++]for(k=0; k<no; k++) { cout<<endl; for(m=0; arr[k][m]!='\0'; m++) { cout<<arr[k][m]; } cout<<" "<<price[k]; }[/code] Interger array input without asking … | |
I am kind of a beginner in C++,started learning the language this year at university. The next day I have an exam.One of the problems that needs to be solved with C++ includes a making a program that by entering a any word(Ex.:"Table")would reverse it,so it would look like :"Elbat". … | |
Hi, I am programming in VC++/MFC to make applications for Bus, Airline and other ticket booking softwares. In those applications i need to display the available Buses/Flights in as in Web pages. i.e., like tables. A row for a flight like that. Currently I am making such a view by … | |
I am using the following to convert serial data over a com port into a deque. The problem I am having is that while data is streaming and things get busy the program tends to crash on this. It works fine for awhile, sometimes hours, it is a multithreaded program, … | |
Hi All, I seem to be getting an error with my code when running Intel C++ compiler via Visual Studio 2005. The error generated is "Expression:map/set iterator not dereferencable" I've given my code below in the hope that someone can spot the problem. [code=C++] set<stl_index>::iterator eit1, eit2=elmt_ids.begin(); bool non_consecutive(false); // … | |
Hi, this is my requirement : I have a c++ library/API in the server and client computers running Java applets can send data over to the server and server after processing will send the resultant data back. What I have done: Following the excellant tutorial at [url]http://www.linux.com/feature/113947?&depth=5&order=1&sortby=3&render=flat[/url] titled "Creating Web … | |
Any ideas how this could be converted to a std::string(). So files8 will be converted to a std::string() [code] System::String ^ files8 = folderBrowserDialog1->SelectedPath->ToString(); [/code] | |
(#143734) 915186754 SendMessage: sender 1, receiver 2, group 1000000000, type 24050, length 384, source 0 (#143781) 915248646 ReceiveMessage: receiver 1, sender 3, group 1000000000, type 24050, length 256, source 0 (#143658) 914941174 Collective: process 1, collective 11, group 1000000000, root 0, sent 0, received 0, duration 242440, source 0 (#143657) … |
The End.