49,761 Topics
| |
| If anyone can send a program "Which counts how many times a particular word is repeated in a file" using File Handling... E-mail: <EMAIL SNIPPED> |
Hi everybody, What I did is, I have 2 one dimensional vector which are inside structure. [CODE]int numberofactivities; struct PopL{ vector<double> RK; //For Random Key }; //Random keys for left population vector<PopL> PopL(3); srand((unsigned)time(NULL)); for (int j=0; j<3; j++){ for (int i=0; i<numberofactivities;++i) { rn=((double) rand() / (RAND_MAX+1)) ; PopL[j].RK.push_back(rn); … | |
struct node { char str[10]; int val; node *next; }; void main() { clrscr(); node *head=NULL;int cnt=0; cout<<"Continue... [Y/N]";char ch;cin>>ch; while(ch!='n') { node *temp; cout<<"Str= ";cin>>temp->str; cout<<"val= ";cin>>temp->val; temp->next=head; head=temp; cnt++; cout<<"Continue... [Y/N]";cin>>ch; } node *temp1; temp1=head; while(temp1!=NULL) { cout<<temp1->str<<" "; cout<<temp1->val<<endl; temp1=temp1->next; } getch(); } Plz help me out....... … | |
Hello, I am new to this site, as well as to C++. I was hoping someone could help me out with my program, I was hoping to incorporate an if, else statement which we have yet to go over to see if I can. I have basic experience in java … | |
Hello, I'm a newbie to Objective-C & iPhone development, hence please bear with[ICODE][/ICODE] me. I'm working on an app which loads with UITableView and upon selecting one particular cell called "Address Book" it should load with another UITableView containing all the addresses retrieved from a web request. Using NSXMLParser's delegate … | |
Hello! I'm new here... and I'm having trouble trying to download and upload files from an ftp server.... Btw this is not for homework! I'm trying to help a professor with this but I'm stuck!... Help?? :/ | |
Hello. I'm supposed to store the two numbers in two int arrays of size 30, one digit per array element. If the number is less than 30 in length, enter enough leading zeroes (to the left) to make number 30 digits long. I will need a loop to add the … | |
Hello. The problem with the following code is that when I read from a file after restarting the program and then try to display the contents, it goes into an endless loop. I hope that someone can point out the logical error hiding there. [CODE]#include <iostream> #include <windows.h> #include <fstream> … | |
Hey everyone, I need to write a program that reads names and GPA’s from a text file. The file looks like: James 3.9 Margaret 3.5 Charles 1.2 Jennifer 4.0 The program sorts the students ascending by gpa, and prints the sorted list including names. To keep the names with the … | |
Hey There! I am doing a research using the principal component analysis as a technique for fault detection, could somebody help me with the C++ code for it( that has the hotellings T squared statistic and the SPE or the Q statistic). | |
Hello to All, I would like to know what is the significance of static member function. Also please mention why all member functions can't be made as static. Thanks, | |
I'm at a point with this program that I need to do a lot of work with strings. This would be so much simpler to do in Python, however I don't want the entire program written in Python. How could I use functions from a Python script in C++? | |
dear sir , My question is what is the sutiable libraies to learn inorder to be a windows programmer . someone say that MFC is not structured well and there are lots of easy frameworks shuch as .NET to do the things very easily than using the .NET . and … | |
For those C++ fanatics: You are free to visit this website: <MY SPAM LINK REMOVED BY peter_budo> To learn the basics of C++ HAppy COding, Enjoy!!!:icon_smile: | |
I need help getting my function to overload the + operator to add a integer and a Rational object. Right now I am able to add two rational objects with my overloaded + function but not and integer and an object. I'm not really sure how to go about doing … | |
I am currently writing a program that can calculate the number of total seconds in a user given number of hours, minutes, and seconds (in that order in hh:mm:ss format hh, mm, and ss being any number from 0-99). I'm not really worried for checking for errors in user input, … | |
I'm having trouble figuring out how to overload the +=, -=, *=, and /= for a program that does operations with rational numbers. Could someone please help me out. [CODE=C++] #include <iostream> #include <string> #include <cmath> using namespace std; class Rational{ public: int num; int den; bool neg; Rational(int n, … | |
How can i store in an integer array a negative number of type string?i mean i want it to be recognized that it is a negative nr. | |
Write a C++ program that implements an ADT class named Int50 for manipulating integer numbers with up to 50 digits. The operators provided on this type must include: sum (+), difference (-), product (*), division (/) {dropping the remainder}, output (<<), and input (>>) of values for Int50 objects. Each … | |
I want to get this string arrays and turn them into double arrays, but i get this : [CODE]#include <sstream> #include <cstdlib> #include <iostream> #include <string> using namespace std; int main () { string str[3]={"2.5","3","1.5"}; istringstream stm; double d[3]; for(int i=0;i<3;i++) {stm.str[i]; stm >>d[i]; cout << d[i] << endl; } … | |
int arr[]={4,5,6,8,1,6,4,7,1,2}; and I want and array to equal the ln of those values in an array? I dont why I am having so much trouble with this. Thanks! | |
Can i apply find_first_of ,substr,istringstream and make_pair to a char array? | |
i tried my writing my first script today :) it is the solving the quadratic equation script and i found it in an older C++ book i'm working through i made some edits to the script since i'm using Dev C++ as my compiler (had this problem but fixed it … | |
Hi, I have a programming project in which I have to create a game where the user can select the upper bound of numbers and difficulty they want and then guess the secret number within that bound and difficulty. So far, this is my code. It compiles and allows the … | |
Hello, new C++ user at University I am trying to find what would be the best way to count and display the even and odd numbers in a sequence. For example, if the user inputted the sequence 2 - 6, then there would be 3 evens and 2 odds, this … | |
Hi, I have an expression tree in which the nodes are operators (union, intersection etc represented by a string "/u") or the nodes are std::sets. How could I access the std::set's values in order to carry out the tree evaluation using the operator functions(set_union(), set_intersection() etc) ? The expressions are … | |
I am trying to write a simple Batch File to launch an exe using some basic CMD PRMPT functions. I know exactly what I need to do, but my only problem is I don't know how to detect the Desktop Folder? What if its in Documents and Settings, or if … | |
So, I have this array and pointer: char array [6]; char *ptr; And this list of array [6] addresses and contents: 0x5010 a 0x5011 b 0x5012 F 0x5013 H 0x5014 X 0x5015 Y I'm looking for the values of the following: a) &array[0] b) array[0] c) *ptr d) (*ptr)+2 e) … | |
I have a function that takes an array, calculates the ln of that array into another array called lnt. I would like to pass lnt back to the main. I know it has something to do with int *foo or something but I cannot seem to get a code to … | |
I'm trying to get my main function to read my class file. It doesn't compile. Here is my main file: [CODE]#include<iostream> #include<iomanip> #include"countertype.h" using namespace std; void main(){ CounterType counter = CounterType(); counter.setCount(2); counter.getCount(); }[/CODE] And my class code: [CODE]#include<iostream> #include<iomanip> using namespace std; class CounterType{ public: int count; CounterType(){ … |
The End.