49,761 Topics
| |
I made the game Mastermind using C++ and would like anyone who wants to test it and let me know what they think. It comes with instructions, but since I wrote them and I know how to play the game, they might not be clear. Note: If this post is … | |
I'm trying to make a program that will read names and numbers from a file, but I'm quite inexperienced in C++ in general, and most tutorials and help threads I read tend to make me confused. So far, I have used a test file with a text like "NameA 01234 … | |
this code is a game that uses socket to be able to connect to each other so that there would be a 2player game.. but there something wrong here...here's the code..i'm using linux as my operating system ..this is the client side.. [CODE]#include <stdio.h> #include <iostream> //#include <conio.h> #include <stdio.h> … | |
How do i get it to cout what the pointer points to and not the pointer address? [code] int main() { Item* items[10]; items[0] = new Item(5); items[1] = new Item(3); items[2] = new Item(4); items[3] = new Item(9); items[4] = new Item(2); items[5] = new Item(0); items[6] = new … | |
I was wondering in a doubly linked list how do check to see if the initial list you have is Null? This what I have (would this be correct): [code] node *middleOut(struct node*LL) { node *current = LL; if(current == NULL) { cout<<"empty list"; } //Rest of code is down … | |
the below code is to allow user to enter many strings of characters until he enters a fullstop (.) Please tell me how can i calculate the total number of strings the user has entered. #include <iostream> void main() { char a[80]; int i,c=0; for(i=0;;i++) { cin>>a[i]; if(a[i]=='.') break; } … | |
hi all! how do I multipluy values inside the array I have tied the following but the compiler is giving me a error double a=(h[0]*b[1])+...... | |
Hi! Can anybody please help me to add many strings in one? I tryied this int a=4,b=5,c=6; string d; d = #a+" Hello "+#b+" bye "+c; I want that d = 4 Hello 5 bye 6 Please help me! | |
I have this problem where you have a list of odd or even number of items in doubly link list and you have delete the middle one. For the even number one you delete the two middle elements, say you have 1,2,3,...,10 you delete 5 and 6, and for the … | |
hello! im trying to make a program where entered values should be displayed in a tabulated form. however, as far as i know, everytime we enter a value and press ENTER, the cursor goes to the next line. is there any way where in if a user enters a value … | |
hii friends..Am new to this community... am a computer science student... I need your help in creating a small c++ game... Its a project for me... I am told to do it in turbo c++... okay... the game is so simple... [U][I][B]A number memory game... random numbers should be displayed … | |
[code=cplusplus] #include <iostream> #include <iomanip> #define _USE_MATH_DEFINES #include <cmath> using namespace std; double meanOf3(double value1, double value2, double value3) { double mean; mean = (value1 + value2 + value3)/3; return (mean); } int main() { float value1, value2, value3; double mean; mean=0; cout <<"Enter the first integer whose square root … | |
hi all, here is a question - all files on windows have certain attributes - readOnly, Archive ect.... how can i add my own custom attributes - Note - i dont want an interface to use them just to be able to get and set them within a c++ program … | |
i need help with a homework problem, it's writing a program that approximates the sum of 1 + x/1! + (x^2)/2! + (x^3)/3! + ... + (x^n)/n! we're supposed to write a program that takes a value x as input and outputs this sum for n taken to be each … | |
im supposed to create an address book and so far have gone as far as getting the input..my problem now is the highlighted section..i have to return bak the info put in initially by the user (first, last name and address), based upon a question to the user to input … | |
I tried to make a simple function that takes an array parameter and outputs it and it keeps giving me th error: \function test.cpp(12) : error C2664: 'func' : cannot convert parameter 1 from 'int' to 'int []' 1> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast … | |
I am new to link list and I have this problem where you have two lists. One list pointed by HEAD has a list of numbers in it, and the second list pointed by LARGE that contains the highest element(s) in the list pointed by HEAD. Each element has three … | |
Im having real trouble seeing this, how do I delete something out of a linked list if it is already there? My current delete function just deletes everything out of the list. the text file contains numbers like this: 75 85 95 25 35 75 85 95 25 [CODE]#include <iostream> … | |
can i have a sample of a working lexical analyzer??plss...i need it for my project.. | |
I have a vector of strings "moves" [code]std::vector<string> moves;[/code] and the Chars: [code] char fromX, toX, fromY, toY; [/code] I use: [code] sscanf(moves[0], "%c%c %c%c", &fromX, &fromY, &toX, &toY); [/code] and Compiler says: [code] error: no matching function for call to 'sscanf(std::string&, const char[10], char*, char*, char*, char*)' [/code] What … | |
[code=cplusplus] if(minrange<maxrange) { cout <<"The numbers that are divisible by " <<increment<<" are "; cout <<endl; for(count=minrange; count<=maxrange; count++) { if(count%increment==0) { cout <<count <<" , "; sum1 = sum1+count; } } [/code] this is the code that i wrote. The code is working fine. However, my problem is that … | |
#include<iostream.h> #include<conio.h> #include<process.h> const int max=5; class stack { int s[max]; int top; int temp; public: stack (int j,int p){top=j;temp=p;} void push(int item); void pop(); void display(); }; void stack::push(int item) { if(top<4) { top++; s[top]=item; } else { cout<<"\nStack is full!"; } } void stack::pop() { if(top>-1) { cout<<"\nThe … | |
[code=cplusplus] #include<iostream.h> #include<conio.h> #include<process.h> const int max=5; class queue { int r; int f; int q[max]; int temp; public: queue(int l,int m,int p){r=l;f=m;temp=p;} void insertrear(int item); void deletefront(); void display(); }; void queue::insertrear(int item) { if(r<(max-1)) { r++; q[r]=item; } else { cout<<"\nQ is full"<<endl; } } void queue::deletefront() { … | |
can someone make a simple program that prints numbers in series depending on the persons input .. for eg :- if input is 5 then output should be : 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 ....please help asap .. thank you … | |
Hi, during an assignment I needed to write a function that, among other things, had to print some of an array values. The simplified version that I show below creates an array of 50 pointers, populates it, and prints the values from main and from a function. I'm really struggling … | |
[QUOTE] * Calculates and displays: o The number of square centimeters of material that are needed to manufacture a specified quantity of flat washers o The weight of the left-over material, after the washers are stamped. In order to calculate the leftover weight - you will need to determine the … | |
:o Hi there!!!!!! May I ask for help? After holidays all my C++ knowledge gone. What I need is to create string from integer number and another string as STRING = INTEGER + SUFFIX where INTEGER is 5 SUFFIX is than 'th' so STRING is 5th | |
I have an assignment to write a pseudo-code to have a list pointed by H (list of numbers) that have to be copied to a list pointed by H1 (only the odd numbers need to be copied). Can anyone tell me if I am wrong on this (not a working … | |
Why do i get this error every time i try to compile an SDL source code? D:\gcc installation problem, cannot exec `cc1': No such file or directory. That's the ONLY error i get. | |
hello everyone....i need some help,i am using c++ and vectors, and text files to create a library system and i have a problem.....i used a vector named v1 and i was trying to use an if else to assign a created vectors elements value to another value example like v[10] … |
The End.