49,761 Topics
| |
I have another assignment for class that I am having some difficulties with. I seem to be able to write the program, except for the fact that it keeps looping over and over and I'm not quite sure how to stop this. Could anyone please help?? Thanks! This is the … | |
I am having problems with my linked queue adt. I don't get any error messages, but it just isn't doing anything in the menu driven client code. It's just to test the queue to make sure it works correctly. The most problem I'm having is with my print function. If … | |
Hi ladies and gents, Wanted to ask a simple question probably for you guys and the answer will maybe be simple aswell, but, I thought, what the heck, I'll go for it :) It just seems strange that when everyone tells to use <iostream> instead of <iostream.h>, <cstdlib> instead of … | |
Would anyone be able to help me with this assignment. I pretty much almost got it, but I'm still stuck. Here is the assignment: Write a program that asks the user for two integers; call them num1 and num2. Make sure the number is between 1 and 9 (including 1 … | |
Hi guys, I'm working on building a server package similar to xampp, and I've done some googling on opening ports with c++ but I cant find a straight answer. Can someone please shed some light on this for me. I'll keep searching google in the mean time. Thanks Guys. | |
Ok i need a program that finds the greatest common divisor of two integers. 1) if A/B is 0 then B is the greatest common divisor 2) if A/B is not 0 then plug B into A and the remainder into B 3) repeat the process I have to use … | |
I'm a computer science student and I have HW for Computer Grahphics my hw talk about How to use a CreateFont() function in MFC If every one have information about it can help me, thanks | |
Hi, i was just wondering how i could do this, Say if i made a char array, password, could i change the input to *'s as soon as the user entered them without seeing normal char's Thanks. | |
#include<iostream> #include<string> #include<stdio.h> using namespace std; int main(){ char s[100]; cout<<"enter the string :"<<endl; gets(s); //memcpy char a[100]; memcpy(a,s,strlen(s)+1);//here if we decrease bytes to be copied to a value less than length of s i.e.(strlen(s)), then s is getting destroyed ...some garbage value is coming cout<<" a : "<<a<<" s … | |
| I'm a little confused about empty arrays. I'm supposed to write code for a function of type boolean that returns whether an array is empty or not. This function is a part of a class called Sequence, and takes no parameters. Earlier in the code, I included a typedef so … |
I am trying to write a function that will read one value of an array. I must prompt the user for an index and then read the its value. I am having a horrible time and need help. [code] // read_one_value(A, n) prompts the user for an index i and … | |
[code]how to validate alphabet character input? for example, i have these choices: a, b, c, d,,, the program will run but erratic. for example you've entered "d3" , how to solve this problem?[/code] | |
I am currently working on a mini project for my class. the project is designing a game called etch n sketch. you first etch out a map then quit the game after youre done. then sketch the etch you just created. the problem im having is the scoring system. score … | |
i'm practicing my use of functions at the moment by writing a program to convert pounds to euros and vise versa but when i try calling the functions that do the converting i get a load of 'expected primary-expression' errors. what dose that actually mean because i'm not really sure … | |
Hi, I'm not sure there is an answer to this question, but here goes. I have a program written in c++ (compiled in windows using devC++) and I can run dos commands easily using the "system function". I can also launch the cygwin bash shell by using this function. Obvously, … | |
Hello, I am using a code to generate random numbers upto 32 char... The problem is that i want to display the 32 characters each randomly because the code is displaying the same char 32 times and i want to get the 32 chars generated randomly... The code is:- [code=c++]#include … | |
Hi, I have this factorial function that I have working just great, but I am not really sure how I am supposed to print the local variable and the recursive call parameter. Any help would be greatly appreciated! Thanks. [code=cpp]#include <iostream> using std::cout; using std::endl; #include<iomanip> using std::setw; unsigned long … | |
Hello friends , I got an important coursework to submit . Let me explain, the coursework consist of a file .. which we must sort, search and we must event create a y-sort algorithm. After much struggle, i was able to use the stringtokensier to input the data from the … | |
works, allows entering a user selected amount of strings, however when i try to display, it displays only the last string, not the whole 'database', whatever you'd call it :) the main question is what is wrong and also, is there any way to not to ask a user to … | |
Hi guys, I'm trying to use a nested for loop to change the first 'o' it finds while testing to an 's' and then exit the loop immediately after that. This is what I have, but it currently changes every second 'o' to 's' [code] for (int i = 0; … | |
My code requires the validation of a string that starts with two letters and ends with six numbers. So, an example would be [B]br474897.[/B] This is what I got so far: [code] bool GetNID(char buf[]) { int i= 0; int length; bool valid = false; cin.getline(buf, 30); length = strlen(buf); … | |
I can't identify the problem can somebody help me? [B][COLOR="Green"] objects.h (abstract base)[/COLOR][/B] [CODE=C++]#ifndef objects_h #define objects_h #include "colorScreen.h" #include "maincontrol.h" #include <ctime> #include <string> using namespace std; class objects { public: virtual ~objects(); virtual void print(const MainControl &inMain)const =0; protected: objects(); objects(const int& inX, const int& inY,const int&inScore); ... … | |
hi all I'm trying to read a document char by char my question is how do I read the spaces as well? Thank you! | |
I cannot figure out how to validate a string so that it accepts both uppercase and lowercase letters as in a name. Here is the code: [code] bool GetString(char buf[]) { int i; int length; bool valid; cin.getline(buf, 30); length = strlen(buf); for (i = 0; i < length; i++) … | |
I need help writing code for my print function in a linked queue adt [B]queue.h[/B] [CODE= CPP] template <class ItemType> // record type for nodes on queue struct NodeType { ItemType info; NodeType* next; }; template <class ItemType> class QueueType { public: QueueType(); QueueType(const QueueType &); // Copy constructor ~QueueType(); … | |
I have working version of code but mu ostream<< function should print data acoording to the row and column specified. Here is the codes :- [CODE]// // 4/11/2008 // This is a header file of Array2D class which stores 2D arrays #ifndef ARRAY2D_H #define ARRAY2D_H #include <iostream> using std::ostream; using … | |
I'm having problem with this code. Here's what I'm trying to do. I want the user to enter the firstname, last name of the person whom he wants to delete from the phonebook. then I try to compare the data entered by user with the names already stored on phonebook. … | |
Hello, I am calling a c++ dll in vb... Everything is working fine.. Just i am unable to write the vb code in order to perform the require action... Code for calling the c++ dll in vb [code=visual basic 6]Private Declare Function do_encrypt Lib "AES.dll" (ByVal text As String, ByVal … | |
Hi, I want to be able to use std stream objects to manipulate files, but some of the files are too big. I want to be able to do the folowing: >int64_t fileSize; >strm.seekg(0,ios::end); >fileSize = static_cast<int64_t>(strm.tellg()); >cout<<"File size is "<<fileSize; This code will output -1 if the size of … | |
Hey guys-- I have been lurking on here for some time as a C++ student. I have a project to complete using cstring and strcpy() as a function within a "simple" program. The psedocode goes as follows: --program accepts 2 string array inputs(using getline) 40 total chars for str1 and … |
The End.