51,593 Topics

Member Avatar for
Member Avatar for sagz

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), …

Member Avatar for sagz
0
157
Member Avatar for savinki

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 …

Member Avatar for Agni
0
101
Member Avatar for Dannyo329

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.:-/

Member Avatar for Laiq Ahmed
0
162
Member Avatar for knowledgelover

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 : …

Member Avatar for mitrmkar
0
394
Member Avatar for freshface001

hi friends, can posible to connect ms-access or sql database with c++ ? if posible tell the tips to do it......

Member Avatar for Nick Evan
1
69
Member Avatar for Traicey

Can anyone explain how bubble sort work or give an example or a simple code that is bubble sorting Thanx in advance

Member Avatar for DigitalPackrat
0
404
Member Avatar for nurulshidanoni

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 …

Member Avatar for Arpy Giri
0
170
Member Avatar for asadullah

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 …

0
62
Member Avatar for marcelomdsc

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 …

Member Avatar for marcelomdsc
0
100
Member Avatar for Roofus

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 …

Member Avatar for Roofus
0
2K
Member Avatar for Alishaikh

[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(); …

Member Avatar for Ancient Dragon
0
89
Member Avatar for Jennifer84

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(); …

Member Avatar for Jennifer84
0
137
Member Avatar for Jennifer84

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 …

Member Avatar for Jennifer84
0
181
Member Avatar for Roofus

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 …

Member Avatar for Roofus
0
136
Member Avatar for Kadence

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?

Member Avatar for twomers
0
47
Member Avatar for Phan

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 …

0
103
Member Avatar for gazoo

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 …

Member Avatar for tesuji
0
896
Member Avatar for farag

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 …

0
144
Member Avatar for En1ro

[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 …

Member Avatar for En1ro
0
138
Member Avatar for Jennifer84

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 …

Member Avatar for Jennifer84
0
119
Member Avatar for savinki

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]

Member Avatar for vijayan121
0
165
Member Avatar for Plasmarobo

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 …

0
76
Member Avatar for Nemoticchigga

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 …

0
51
Member Avatar for savinki

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

Member Avatar for William Hemsworth
0
67
Member Avatar for manzoor

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 ?

Member Avatar for William Hemsworth
0
104
Member Avatar for ro4782

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

Member Avatar for William Hemsworth
0
102
Member Avatar for Snaku919

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&); …

Member Avatar for Snaku919
0
250
Member Avatar for savinki

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 …

Member Avatar for Nick Evan
0
92
Member Avatar for manzoor

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 ?

Member Avatar for manzoor
0
83
Member Avatar for timdog345

[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 != …

0
291
Member Avatar for xlx16

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 …

Member Avatar for Nick Evan
0
101
Member Avatar for farag

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 …

0
80
Member Avatar for paradox814

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 …

Member Avatar for bugmenot
0
280
Member Avatar for StrawberryChips

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 …

Member Avatar for Agni
0
336
Member Avatar for blainer27

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 …

Member Avatar for Salem
1
77
Member Avatar for toolbox03

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 …

Member Avatar for VernonDozier
0
108
Member Avatar for hmaich

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 …

Member Avatar for Duoas
0
120
Member Avatar for marcelomdsc

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.

Member Avatar for marcelomdsc
0
75
Member Avatar for rigers

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 …

Member Avatar for Ancient Dragon
0
97
Member Avatar for code12

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 …

Member Avatar for code12
0
235
Member Avatar for Jennifer84

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...

Member Avatar for Jennifer84
0
115
Member Avatar for Jennifer84

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]

Member Avatar for Jennifer84
0
127
Member Avatar for Spagett912

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 …

Member Avatar for Spagett912
0
248
Member Avatar for 3m4d

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 …

Member Avatar for hammerhead
0
369
Member Avatar for BAEdwards

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 …

Member Avatar for mitrmkar
0
282
Member Avatar for d.p.l

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 …

Member Avatar for Nick Evan
0
72
Member Avatar for scream2ice

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 …

Member Avatar for scream2ice
0
425
Member Avatar for daniel88

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 …

Member Avatar for Radical Edward
0
137
Member Avatar for Jennifer84

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 …

Member Avatar for Radical Edward
0
194
Member Avatar for gljiva18

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

Member Avatar for Salem
0
26

The End.