51,593 Topics
![]() | |
Hi all, I am a newbie to programming and have almost complete my assignment 'Frequency of words and phrases' to a satisfactory standard. My program reads a text file and counts the number of phrases within the file (A phrase is defined as a sequence of one or more words), … | |
This is the code segment I hv written. But its compiling well. but it doest give expected output, for me.. I want to write a function to split a char array by taking "," as the delimeter. I m not splitting the array at once. I m doing it one … | |
Hey Everyone. Is there any way to make a sub? For example there's int main(), can I make something else like int menu() and sort of link int main to int menu? I have no idea how to do this.:-/ | |
Hi C++ experts , actually my knowledge is not very good I can call my self degree 2 beginner , But I know how to do things in C#, and write now I need to execute what I have already done in C#, in a c++ code. MORE EXPLANATION : … | |
hi friends, can posible to connect ms-access or sql database with c++ ? if posible tell the tips to do it...... | |
Can anyone explain how bubble sort work or give an example or a simple code that is bubble sorting Thanx in advance ![]() | |
this is the sample program of selection sort, which is given the value. But, how to call the value from read file? anybody knows? [ICODE] #include <iostream> using namespace std; void selectionSort(int *y,int n)//selection sort function { int i,j,min,minat; for(i=0;i<n;i++) { minat=i; min=y[i]; for(j=i+1;j<(n);j++) //select the min of the rest … | |
Here I am going to explain how to make a class so that user can create object of it on free List( heap memory) or Stack. Example 1: Object should be created Only On Heap memory.Idea is that make constructor as private so that no one create on stack. But … | |
Given the declarations: int n; char ch1; char ch2; and given that n contains a two-digit number, translate n into two single characters such that ch1 holds the higher-order digit, and ch2 holds the lower-order digit. For example, if n=59, ch1 would equal '5', and ch2 would equal '9'. Then … | |
I have a feeling this question might be a no brainer to all you. But is it possible to convert a string object to an istream obj. Because what I need to do is read the string expression and then calculate it using the "read_and_evaluate(istream&)" method in my if else … | |
[code]#include <iostream.h> #include <string.h> #include <vector.h> #include <fstream.h> using std::string; using std::vector; void function(vector<string>&fn,vector<string>&fnum,vector<string>&ln,vector<string>&lnum); void main() { ifstream fin,f2,f3,f4; //First name input vector <string> fname(25); fin.open("firstname.dat", ios :: in); for( int i= 0;i<25;i++) fin>>fname[i]; fin.close(); //Second name input vector <string> fnum(25); f2.open("firstnum.dat", ios :: in); for(int i= 0;i<25;i++) f2>>fnum[i]; f2.close(); … | |
I have this code that opens a Form. This code does work but if I just close the Form that did open with this code and press the button5 again, I will have an Errormessage: [B]"Cannot access a disposed object. Object name: ´Form2´."[/B] But if I change: this->form2instance.Show(); to: this->form2instance.ShowDialog(); … | |
I have a Form witch scrollbars that is called Form2. Is there any way to programatically go to the top of the Form without having to scrollup with the mouse ? So if you have scrolled down to the end of the form. Is it possible to press a button … | |
Hi guys, I was wondering if I could get some help on the topic of recurrsion. A week ago i was told to create a application using nodes. this week I need to convert the reverse_list fuction I made below into using recursion. any help would be great thanks. not … | |
Is there any difference between regular expressions in C++ and in PHP/Perl? Or can one use the same regular expressions in C++ as in PHP? | |
I haven't been on the forums for over like 20 days because I have been busy with things, and then my internet died. Not that anyone cared, but I'm just saying this so Vmane won't think that I just copied his code solution and ran away if he stumbled upon … | |
Hello Everyone, I'm new to the forum, currentely I'm taking the basic C++ class and struggle through, it has been over 20 years since write any codes. I have some trouble with the code below, it work fine if I don't bother to check for leap year, but the assignmnet … | |
I write an application by C++ language and I used CGI to make the Interaction by a web page so I found problem that every once I use The web page that I created by C++, C++ application program run from it's First point so I want a solution for … | |
[CODE=C++]struct gydytojas { int gydid, amzius, specialyb, telefonas, asmkod; String vardas; String pavarde; String adresas; friend ostream& operator<<(ostream& os, const gydytojas& obj) { os << obj.vardas.c_str() << obj.pavarde.c_str() << obj.adresas.c_str() << obj.gydid << obj.amzius << obj.specialyb << obj.telefonas << obj.asmkod; // Print the members to os like you would to … | |
I am running this loop where I am substr a vector like below and then ´creating´ a new string "NewData" that I will pushback in a new vector. The thing is that I got an Error message when running this code but if I instead change these 3 lines to … | |
i want to convert stringstream into a string type e.g. [code] void countParameters(stringstream p_InputDataToCount, unsigned int &counter, char Delimeter) { size_t found; //stringstream convert ( p_InputDataToCount ); //convert>> std::hex >> m_nCommandID; //I want to do somethong like this found=[COLOR="Red"]p_InputDataToCount[/COLOR].find_first_of(Delimeter); while (found!=string::npos) { counter++; found=[COLOR="red"]p_InputDataToCount.[/COLOR]find_first_of(',',found+1); } }[/code] | |
This is mildly aggravating, but my flex and bison generated files won't compile under Visual Studio C++ 2008. It has to do with some of the structures (yyval for starters) and some apparently loose characters in the files. I'll post the compiler output, but this is my third day of … | |
I am trying to read from a serial port using System::IO:: Ports in visual studio 2005. I can write fine, but reading isnt reading in anything to the buffer. I am using the following code, similar to the way i was writing to the port. [CODE]array<unsigned char>^ messageBuf = gcnew … | |
i m getting this error. but i couldnt identified where i have gone wrong. could someone explained, normally in which situations this type of error occurs. Error 1 error C2248: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private member declared in class 'std::basic_ios<_Elem,_Traits>' c:\program files\microsoft visual studio 8\vc\include\sstream 513 | |
how do you find the smallest and largest number of 3 numbers without using logical operators and else statement only if and relational operator ? is there any other way without checking every variable against each other using if statements ? | |
I have tried eveything to count the reccurrence of just the word hello. I open a file and can count the words in the textbox but can't count just the on word that i want. Please help with this problem. thanks | |
Euhmm Ok i got some error that tells me that i can't open the program because there some error in my syntax but I really don't know where is the problem it self. #include <iostream> #include <iomanip> #include <cmath> #include <fstream> using namespace std; void voircatalogue(fstream&); void ajoutitem(fstream&); void ajoutclients(fstream&); … | |
In windows getline(,,) returns *this. And Errors are signaled by modifying the internal state flags e.g. eofbit, failbit, badbit. e.g. No characters were extracted -> then state flag = failbit I want to do erro handling to this. since this retuens pointer how can i do this. Can some one … | |
ok in what way do you separate the digits from a given int ?? like if the int is 987987 how do you separate them in to 9 8 7 9 8 7 ??? is there any function to do this ? | |
[code] void firstClass(int f); void businessClass(int b); void coachClass(char typeTicket); int main() { char type; cout<<"Please enter your which class you want to fly. (f=firstClass, b=businessClass, c=coach)"; cin>>type; cout<<endl; //bad data check while (type != 'f' && type != 'F' && type != 'b' && type != 'B'&& type != … | |
mybe i should ask my question in another way. question: we want to make a text editing program, first of all how we can make a space for user to write in it(make an arry with a lot of space exp:char txt[1000]; ?!!!) secend ,this program suppose to do flowing … | |
I write an application by C++ language and I used CGI to make the Interaction by a web page so I found problem that every once I use The web page that I created by C++, C++ application program run from it's First point so I want a solution for … | |
I am stuck on something that I know is so simple that I can't figure it out... I have a BST class, and a private item: [code]Node<K> *root; // root pointer //and in a seperate class I have... template <typename K> class Node { public: // constructors Node() {}; Node(const … | |
First off I'd like to say I'm a beginner in C++ (VB was my stronger point I think), so be gentle about how gigantic my code is. I've been working on a project for a class for a couple days now, it's not due for a couple days, but for … | |
Hi, I'm currently in a C++ class and I have this one problem where you are supposed to try and create a calculator which will take the equation like this: (-insert equation here) = I can't seem to get it to work for the life of me! I was just … | |
I have a txt file of this format: 2 Jack S123 Y 1 Choco P0001 5.50 2 Jane S456 N 2 Rice P0002 10.00 2 Chicken P0004 7.50 1 how do i create the loop to store the data into 2 classes? my code for (int i = 0; i … | |
Hello all, I have a doubt concerning to overloaded operators. Does the compiler create new temporary object to the elements involved on the overloaded operation? E.g. Operator + overloaded. a = b + c; Does the compiler creat temporary object for b and c? See the following code and the … | |
Hi I'm not really sure how to solve this, if a system supports ten digits of precision for floating-point numbers, what are the results for the following computations? a. 1.4E+12 + 100.0 b. 4.2E-8 + 100.0 c. 3.2E-5 + 3.2E+5 Thank You. | |
Problem 1a: Write a program that generate random text as follows: the uses chooses a max number of words it reads in a text file chooses a random word it prints the random word it then finds the next instance of that word in the file it selects the word … | |
Here is my code for the program. which I'm trying to complie...I just started testing it and was going through it step by step...but the first function whichI started testing is getAccountNumbers, but there are some issues with it, here's the code, it has Person file included in it, it … | |
How is it possible to delete all Rows from it´s contents in a dataGridView1 ? For example I have 10 Rows and 15 Columns with Information. Thanks... | |
How is it possible to programatically select Row 2 in a dataGridView. I know how to do it for a checkListBox like below but can´t find a member simular to this in the dataGridView. [code] checkListBox1->SelectedIndex = 2; [/code] | |
I'm trying to translate the following code from C++ into Asembly language but am having trouble. I know that I have to make a cmp and one or more jmp. If any1 has sugguestions or tips thats great. Here's the C++ coding: [CODE] int x = 1 * 2; int … | |
Could sum1 plz help me undastand these Questions just wna no how it is done fank u 3. If DoSomething is a void function that takes an int expression as an argument, which of the following is an incorrect statement? (Assume all variables are int variables.) A) DoSomething(n); B) DoSomething(3*n … | |
Hello all, I am submitting this post because I am having problems with implementing threads in my code and wonder if someone may be able to tell me what is going on! I am using Borland C++ Builder3 to create a GUI based application. This application contains a lengthly search … | |
Hello, I'm a beginner programmer and I was looking to see if anyone has a book or online tutorial that they have either used or heard about that's any good. I've seen a lot of online tutorials but they seem to get a bit dodgy when talking about Arrays and … | |
hi i have an n*n page (n is a power of 2) with an empty place in it, and i want to fill in this sqaure with right trominos (a tromino has an 'L' shape) i want to show the empty spaces with zeros and the ones filled with trominos … | |
Hi guys, I am currently working on a practical for a first year computing subject. I am determined to work it out because I think it will really unlock pointers and dynamic memory allocation for me. Essentially, the task requires that I produce a program which, when prompted, will store … | |
Is it possible to Show a MessageBox or Something simular to a MessageBox that by it self will show for about 2 seconds so you doesn´t have to press OK. So what happens is that a "messageBox" will appear for about 2 seconds and the by itself dissapear ? (A … | |
Hello my name is Boris and I need help with animation in C++ . I need to make a clock . My knovlege in c++ is not big enough and I cant find any one who could help me with that problem |
The End.