49,761 Topics

Member Avatar for
Member Avatar for DarkPyros

hey, i'm supposed to prompt a user to enter 6 sets of numbers, find the difference of each set based on which number is greater(so that no negative number will be seen, enter the difference into the array, rearrange the array in ascending order and then print the array. the …

Member Avatar for DarkPyros
0
179
Member Avatar for yashsaxena

Hello All I have little confusion between Abstraction and encapsulation. Abstraction means Giving only essential things and hiding unnecessary details. Encapsulation means binding the data members and methods together in a capsule form to avoid accidental changes to data from external users. Now both uses hiding of data. What is …

Member Avatar for yashsaxena
0
4K
Member Avatar for watery87

Hello, would like to ask about this problem im facing. [code] #include <cstdlib> #include <iostream> #include <fstream> #include <ios> #include <string> #include <string.h> #include <vector> #include <sstream> #include <algorithm> #define MAX_MSG 30 using namespace std; vector<UserInit> ReadUsersInitial() { fstream file ("Users_initial.txt"); FILE *file1 = fopen("Users_initial.txt", "r"); string tempFile; if (file.good()) …

Member Avatar for drkybelk
0
124
Member Avatar for dgreene1210

I;m having a hell of a time this simple program im trying to create... any help would be great! most of it is right except can't get the formula to show up so theres an extra line of code in there because i dont know what to do this is …

Member Avatar for dgreene1210
0
262
Member Avatar for annitaz

[CODE]template < class Object> void fix(queueType < Object> &q, int n) { -if (n>=1) -{ ---Object temp = q.front(); ---q.deleteQueue(); ---fix(q,n-1); ---q.addQueue(temp); -} }[/CODE] (a)what will the final state of queue q1 be after the statement fix(q1,2); is exexuted, if q1 has the values (1,2,3,4,5} my answer: {2,3,4,5,1} because q.addQueue …

Member Avatar for annitaz
0
195
Member Avatar for Ertzel

I'm trying to get a players name from a file on their computer and then display that name onto a Label on my chat program. This Label is also used when sending messages to the server in order to display the persons name with their message. The problem I'm having …

Member Avatar for Ertzel
0
204
Member Avatar for Labdabeta

This is a conversion question that has me stumped. I need to convert an unsigned char to a signed float. Some examples: 0xFF becomes 1.0f 0x00 becomes -1.0f 0x80 becomes ~0.0f The only idea that I could come up with was a massive switch statement. But a switch statement will …

Member Avatar for ddanbe
0
345
Member Avatar for snipermann

Hello I am working in my study with xml file therefore I want to read an xml file with c++ to get the information such the coordinates of the points in order to use them later. I have written the following code, but [U][B]I have just taken only one value[/B][/U]. …

Member Avatar for ravenous
0
317
Member Avatar for NoUserNameHere

[CODE]void SortedNumberList::add(double number) { ListNode *nodePtr, *previousNodePtr; if (head == NULL || head->value >= number) { head = new ListNode(number, head); } else { previousNodePtr = head; nodePtr = head->next; while (nodePtr != NULL && nodePtr->value < number) { previousNodePtr = nodePtr; nodePtr = nodePtr->next; } previousNodePtr->next = new ListNode(number, …

Member Avatar for prvnkmr194
0
129
Member Avatar for sadsdw

Hello everyone, I'm trying to declare a 2-dimension (A[][]) dynamic matrix but I'm having problems ... The A's elements need to be FLOAT. The size of lines and columns are both vectorX.size(). Could you help me please? One of error's message is: "cannot convert `double' to `float**' in initialization" [CODE] …

Member Avatar for sadsdw
0
107
Member Avatar for shilosimi

Hi there. I'm trying to write a program that will establish a DB of names and Ids. The thing is i don't want to scan the entered data to a temporary variable and then put it into the file, but to scan the user's input directly to the file itself. …

Member Avatar for Narue
0
237
Member Avatar for Bulls2012

[B][U]Write a class named Employee that has the following member variables:[/U][/B] [B]name:[/B] The name attribute holds an employee’s first and last name [B]idNumber: [/B] The idNumber attribute is a string variable that holds an employee’s ID number [B]department: [/B] The department attribute holds the name of the employee’s department [B]position:[/B] …

Member Avatar for ragedsparrow
0
373
Member Avatar for mattloto

I'm trying to make a calculator that parses input like [TEX]( 3 + 2 ) * 5[/TEX] I want to use formal grammar for this, and I'm wondering how to organize this. I was thinking having a class for Value, which would basically just be a number. Then I want …

Member Avatar for mike_2000_17
0
135
Member Avatar for ravenous

There are occasionally posts asking how to remove white space from string of characters (either a C-style `char` array, or a C++ `std::string`). Using functions in standard C++ libraries, this is quite an easy thing to do: #include <string> #include <algorithm> #include <iostream> #include <cctype> int main() { /* Make …

Member Avatar for Narue
1
2K
Member Avatar for ctrlaltcasper

Ok this is my situation I have this header file: [CODE]struct dir { char name[3]; int root_dir; int has_children; int num_children; int offset_to_children[2]; int offset_to_files[16]; }; struct files { char name[5]; int size; int offset_to_beginning; int has_fragment; int next_fragment; }; struct fat { int files; int dirs; struct dir *dir_array; …

Member Avatar for Ancient Dragon
0
219
Member Avatar for Ahmed sunny

hello.. [COLOR="Red"]i need code for finding all possible combination of repetitive characters using recursion function.[/COLOR] actually the question i s "Imagine a robot sitting on upper left corner of NxN grid. the robot can only move in two direction "Right" and "Down". write a recursive function to find all possible …

Member Avatar for predator78
0
385
Member Avatar for sofiastrange

Hello everyone, i have written a program in c++ using Microsoft visual studio which runs perfectly, at least to my satisfaction. However i thought it would be nice to create a graphical user interface to it, and i have used Ms Visual C++ to design one and Visual c++ can …

Member Avatar for drkybelk
0
272
Member Avatar for Uzair Malik

can some one tell me a prog of making different combinations using recursion in c/c++ and it should also be a function

Member Avatar for predator78
0
286
Member Avatar for Labdabeta

How can I send an email through C++. I need to make the following: [CODE]bool SendMail(char* from, char* to, char* title, char* msg) { //What now? //Return true on success, false otherwise }[/CODE]

Member Avatar for Labdabeta
0
127
Member Avatar for lexusdominus

Hey, does anyone know which function/s i need to use to copy a file from one subdirectory to another, without changing the name? im on windows if that helps.

Member Avatar for WaltP
0
143
Member Avatar for Smartflight

Ok, I received an assignment today, and we have our weekly test tomorrow. I was going through the 25 questions, and this is my first problem... The question is as follows: Write a program to keep count of created objects for a class. Make suitable assumptions. For example, in the …

Member Avatar for mike_2000_17
0
115
Member Avatar for noormoon

Hi every one, in fact need helps very quicly, I have project system have to use c++ program but i dont know how to include file in program to read and write. I will put my soluation to help me some one and the question, to know the person who …

Member Avatar for noormoon
0
89
Member Avatar for Sandhya212

Hi, I need to find the 'length' of union between 2 vectors. The code I have is[CODE] vector<int> v1,v2; vector<int> unionsetv; vector<int>::iterator it; v1.push_back(1);v1.push_back(2);v1.push_back(3); v2.push_back(3);v2.push_back(2);v2.push_back(4); it = set_union(v1.begin(),v1.end(),v2.begin(),v2.end(),back_inserter(unionsetv)); cout << unionsetv.size()<< " "; cout << int(it - unionsetv.begin())<< " " ; [/CODE] I could not get this to work and …

Member Avatar for Sandhya212
0
230
Member Avatar for pdwivedi

Can any body suggest me how can I free the dynamic memory in the given code [CODE]int fun(CString qry, CStringList *List,int n) { using namespace std; string sqlStmt = qry; int i; this->stmt = this->conn->createStatement (sqlStmt); ResultSet *rset = this->stmt->executeQuery (); string **oraRecordsStr=NULL; try { while (rset->next()) { if(oraRecordsStr == …

Member Avatar for Caligulaminus
0
115
Member Avatar for 123priya

[CODE]#include<iostream.h> void main() { void prn(int a); void prn(int a,int b); int x,y; cout<<”\n enter a number”; cin>>x; prn(x); cout<<”\n enter two numbers”; cin>>x>>y; prn(x,y); getch(); } void prn(int a) { cout<<a; return ; } void prn(int a,int b) { cout<<a<<b; return ; }[/CODE]

Member Avatar for tkud
0
92
Member Avatar for Adil_

Well, I'm not exactly an expert with C++, and I have been making a text RP for general use. I'm having some problems.[CODE]#include "Library.h" void main() { //welcome screen cout <<"####Welcome to Xe0n RP, part of the Xe0n project started by Adil\n"; cout <<"####Programmed in C++\n"; cout <<"####Currently in beta\n"; …

Member Avatar for asasasasasa
0
159
Member Avatar for HASHMI007

[CODE]//plz run .an accrued .Processor fault error.plz help me /* Bank taransection Program.cpp : Defines the entry point for the console application. */ #include "stdafx.h" #include<iostream> #include<string.h> #include<string> #include<process.h> #include<conio.h> using namespace std; class details { public: char *name; int age; char branch[50]; char city[40]; void getdetails() { name=new char[20]; …

Member Avatar for HASHMI007
1
108
Member Avatar for ocramferreira

Hi all, well my problem isn't a practical problem. I have a project to do which is a word game.First of all i have a .txt (a dictionary) my program has to fetch a random word and shuffle it. With the combination of those letters the program has to find …

Member Avatar for iamthwee
0
569
Member Avatar for jimJohnson

Could someone please run this code in XP and let me know if it works. I am on Windows 7 and have looked at this code for 2 months now and not able to find a solution to save my life. If you see what is wrong with it though …

Member Avatar for jimJohnson
0
135
Member Avatar for n0de

Hi, new to vectors.. I have a little problem with them - with arrays you could just do like array [ index ] = new value, and everything is ok. How it is with vectors ? how can i change specific index value ?

Member Avatar for mike_2000_17
0
91

The End.