49,761 Topics
| |
Hello, I'm attempting to write a function that accepts a vector "list" and it's "size" as arguments and using an iterator, step through the list to find the one with the highest value. For instance, here is the non-iterator function: [code] int winnerIndex(vector<int> list, int size) { int votes = … | |
Hi, I assigned the name of the file to string vector. I mean when I print the vector, it seems like cout<< files[0]; It prints file.txt and I want to open the file by using vector. I tried ifstream file ("files[0]"); and ifstream file (files[0]); but they did not work. … | |
Hey yall. Trying to teach myself C++ using the book "Programming and Problem Solving With C++" (5th ed.) by: Nell Dale and Chip Weems... and it's no cake walk. I have a new found respect for programmers and programming in general. Anyway, if any of yall can help me figure … | |
I'm using eclipse C++ helios and mingw compiler... I created a hello world project without modify the original code.. It compile successfully but when i click run, it show terminated test.exe I'm new to use eclipse IDE, so hope to get some helps here.. thanks | |
Hi all, I am working on an application in which a call is made to a DLL. From that dll a dialog has to be displayed. While doing so I was not able to see the dialog. Dialog is not getting displayed. When i checked the code in debug that … | |
The Program has been started but I am having issues finishing the public class in the header and finishing the functions inside the main file. [B]Header File:[/B] [CODE]#ifndef POLYNOMIAL_H #define POLYNOMIAL_H #include <iostream> /** This class implements a polynomial of the form c0 + c1 x + c2 x^2 + … | |
I'm rather confused on when i would use and what the following libraries( of frameworks[not sure what they are] ) would be used by a programmer. If anyone could please give a simple understandable definition i would greatly be appreciated. ATL MFC COM pretty much when would the following be … | |
hi does any one know libraries for wireless programing? | |
Time to time I see some common mistakes or even make some my self. I figure I would post some of these, with hopes that people will learn from my and others mistakes. [B]1) Why you no work?[/B] [code] int sum = 0; for(int i = 1; i < MAX; … | |
Hi, I wanna ask you if there is SIMPLE way to check if file called XXX is in path YYY? I have this Code: [CODE]int GetLocation() { GetName(); string location; location += "C:\\Users\\" + name + "\\Documents\\test.txt"; if(location) return 1; else return 0; } int main() { if(GetLocation() == 1) … | |
[CODE]#include<iostream.h> #include<conio.h> class student{ //student class // student class attributes // Access specifier is by default private int ID; char * name; public:// public acccess specifier // student class functions/ operations void login(); bool Select(); void read(); }; // end of student class // ******************************************************************** // ******************************************************************** // ******************************************************************** class … | |
Hi everyone, I have a directory that have 100s of txt files. (Folder is Data_Sets_30) I want to open txt files one by one and get values and close the file and open next txt file get values and close the file and continue like that. I started to code … | |
trying to figure out how to work out cin.ignore(100,'\n'); [code] cin>>idnum; while(!cin.eof()) { cin>>code; if(code == 'm' || code == 'M') { } if(code == 'h' || code == 'H') { cin>>hours; if(hours<=forty) { } if (hours > forty) { } } if (code == 'C' || code=='c') { } … | |
So we were offered a job yesterday, which involved developing a mobile app targeting multiple platforms. They need the code to be as cross-platform as possible, so I think that C++ is the way to go as far as the infrastructure is concerned, and then we write wrappers in other … | |
i need it can some one help me out with it quest -- write a program in c to input any 10 numbers and print how many are even and odd waiting for responce | |
#include<iostream> using namespace std; class polynomial { private: struct p { int degree; float coefficient; p *link; }*head; public: polynomial() { head=NULL; } void getdegree(); void getpolynomial(int d); void display(); void addition(polynomial p1,polynomial p2); }; void polynomial::getdegree() { int degree1; cout<<"\n Enter the highest degree of your polynomial:"; cin>>degree1; getpolynomial(degree1); … | |
[CODE] void findFacesInMesh() { multimap<indexPair, int> mapface; multimap<indexPair, int> ::iterator it, it2,it3; pair<multimap<indexPair, int> ::iterator,multimap<indexPair, int> ::iterator> rangeit; int ip1, ip2; for(int k=0; k!=cells.size(); k++) { for(int i=0; i< ( cells[k].getNbPoints() ); i++) { if(i== (cells[k].getNbPoints()-1) ){ ip1=cells[k].getListPointsIndex(i) ; ip2=cells[k].getListPointsIndex(0);} else {ip1=cells[k].getListPointsIndex(i); ip2=cells[k].getListPointsIndex(i+1); } mapface.insert( multimap<indexPair, int> ::value_type( indexPair(ip1,ip2), k) … | |
Hey, so I need to calculate and display the mode (most frequently occuring number) from a vector of ints. I already have the vector, and it can have any number of elements in it. So now i need to figure out a way to loop through my vector to figure … | |
I'm trying to understand how one might go about building a program with a spreadsheet widget and being able to save the data in that spreadsheet? (Just Conceptually). The basic aim here is to input data on a regular basis using a C++ GUI of some kind and having that … | |
Hello everyone, I have a std::map that includes individual ID and a struct that contains father and mother information, read from a file "ped.txt". This file has the format: ID - FATHER - MOTHER. Some fathers or mothers don't have IDs as individuals. The code bellow is an example to … | |
hey. i would really appreciate some help on an assignment i've been struggling with. i am supposed to: Write a calculator program. Each time the program starts, reset the current value to zero. The user will then enter an arithmetic operator (either +, -, * or /) and then a … | |
Hello all, I have put together an inventory program and having problems getting it to compile and run. I am at my wits end, with it. I'm not sure what it is that I'm missing. Any help would be greatly appreciated. Thanks in advance. [CODE] #include <iostream> #include <string> #include … | |
Hello i want to get my computer time using c++ i googled, but i couldnt find anything that suits me... Time code should be able to use this function: if(hours == 10) { do something... } Can you help me? Thank you. | |
Hi Guys, What is the scope of the exception variables when I catch them by reference. [CODE] try{ throw AnExceptionObect("Exception message"); } catch(AnExceptionObect &exp){ logger << exp.what(); //logger is a dummy object throw; //what will happend now? is it going to be throwen by value? and what if I catch … | |
OK, so as C++ is new to me I am confused. Generally I would pass an object using the "ref" keyword and I'd have no issues retaining the information that was changed in my object when I got back to the main. Well C++ is different. I have a class … | |
I know C++ well and have written some programs in it but when I look at a program's code,I can't understand it.I wanna know is there a place where I can learn to write real world programs?Sth like a C++ certification? thanks | |
hi everyoen i've a matrix array with some value, i want to shaw each of them in matrix type in my form, how can i do it? can i use DataGrid view for this? and if yes ... what is method.. | |
Hi, I just started a C++ class and I'm already having troubles with some parts. The instructions are as follows: "Create a C++ console applications to compile the following statistics on a list of integers: • minimum value; • maximum value; • median value; • arithmetic mean; • variance (population … | |
This is a problem in a programming contest but I am stuck at it for the past two days Here is a link to the problem : [URL="http://www.techgig.com/codecontest_detail.php?type=advanced"]http://www.techgig.com/codecontest_detail.php?type=advanced[/URL] [CODE]void DrowningVillage(int gridSize,int villageHeights[][10],int origin[]) { int i=0,j,k=0,x=origin[1],y=origin[0],z=0,output1[100],Heights[10][10]; for(i=0;i<gridSize+2;i++) for(j=0;j<gridSize+2;j++) Heights[i][j]=1000; //For removing garbage values and for later comparisons for(i=0;i<gridSize;i++) for(j=0;j<gridSize;j++) Heights[i+1][j+1]=villageHeights[i][j]; … | |
I have created a program that reads data from a file and stores it into a vector. The data looks something like the following: 48.698635 -0.000000 0.000019 1.000000 -0.004386 0.002192 // Step 1 48.583797 0.114838 0.100000 1.099997 -0.005061 0.001945 //Step 2 48.457909 0.125888 0.100000 1.199994 -0.005854 0.001883 //Step 3 ect... … |
The End.