General C++ Programming - September 2015 (Page 8)

by Radar
Wierd errors
 
FIXED, Please go on to next comment Getting weird errors #include <iostream> #include <ctime> #include <cstdlib> struct enemySpaceShip { int xCoord; ...
[1 reply] : You have an array of 5 arrays of 3 space ships. ship[ i] , ship[ i] ... (by Peter87)
program works once, but won't loop
 
Hello! new forum user and fairly new at c++ I have this program I've written for a class and it seems to do everything it needs to (output to the text file spe...
[3 replies] Last: thanks for your reply and time with this problem, unfortunately, I can... (by sublimestyle90)
Assignment- generate random angle theta within and circle and calculate chord length
 
Could someone please give me a clue. Thanks much for any help! theta between 1-180 degrees // Program to generate a random angle and chord subtended by sai...
[2 replies] Last: Thanks Duoas! (by EPaschall)
for loops
 
So i'm writing a program to calculate the total rainfall. The problem i have is when I am outputting the month and rainfall to the screen. What is happening is ...
[2 replies] Last: http://www.cplusplus.com/articles/jEywvCM9/ (by SamuelAdams)
by Ozzy69
Help me with this exercise in C
 
I can't a logic for this exercise! make a program that count (00) 16 to (FF) 16. The result on the screen should be as follows: 00 01 02 03 04 05 06 07 08 ...
[1 reply] : when you can't reason it out in your head write it on paper. Your on t... (by SamuelAdams)
by Radar
Odd Output
 
#include <iostream> #include <ctime> #include <cstdlib> struct enemySpaceShip { int xCoord; int yCoord; int shipNumber; }; void disp...
[2 replies] Last: Line 33: // ship .shipNumber = ++i; // engenders undefined behaviour... (by JLBorges)
by shahki
lvalue required as left operand of assignment
 
I’m getting errors when trying to add two data type SmartArrays together. I think the error is within the assignment operator but I can’t seem to figure out...
[3 replies] Last: They both need to be fixed. The const versions should return const ref... (by LB)
add/delete/output with file c++
 
With the .txt file below for example. I need some suggestions how I can add information to the file, or delete a certain line, and how to save the changed .tx...
[2 replies] Last: I have to make a menu, then choose which line the user wants to delete... (by shinyspear)
Othello program
 
i have a program need to build superpower how to do it?anyone can help?
[4 replies] Last: void loadGame(){ //load a game string filename; cout << " Ente... (by mike9407)
counting freq of words in a array
 
Write a C++ program that will dynamically resize a word structure array that stores the frequency of words found in a file. The array should start with enough ...
[1 reply] : What you are being asked to do is create a histogram , which is just ... (by Duthomhas)
I need to insert set STL container to insert(int k) function
 
Dear Community ,I'm trying to insert a set STL container into insert(int k) function;but the Linux Compiler says me: "set-btrees.cpp:336:23: error: no match for...
[1 reply] : A std::set does not have an operator . Fortunately, C++11's rang... (by Duthomhas)
Console window editing.
 
If i am using arrow keys and edit the input, then the output gives error. Any idea, if wrong input is typed, we must use only del button??..
[2 replies] Last: That is not, actually, a C++ problem -- it is a problem with your term... (by Duthomhas)
by Ecilef
Help, how to put categories in hangman game?
 
We're just newbies in c++ so we have been doing a program called hangman where there should be 4 categories. For example : 1) c++ 2) Physics 3) Chemistry 4) His...
[5 replies] Last: oh! we fixed it! :D we still need some polishing in the program, but i... (by Ecilef)
Help writing this programm
 
Hey... I have this programm that I am writing for class and I am having some trouble with it. I want it to write a program to calculate sales totals for a gener...
[1 reply] : It seems you logical part is ok for me...check the syntax part...curly... (by sankar86)
NEED HELP ON PROGRAM STARTER HERE!
 
Hi guys, Please help me to make this program :( I REALLY NEED HELP IM STARTER *Sorry if i posted in wrong section* >A Manufacturer needs a program to disp...
[1 reply] : Here is the idea.. Enter small,large,cost; in main Table (small,large,... (by sankar86)
by Noni
Help on developing a program
 
Write a function to generate nth term of fibonacci sequence.use this function to print first n terms of the sequence.plzz help and give solution ASAP
[1 reply] : Here is the code for starting... cout << "1 1 "; while (temp < 2... (by sankar86)
RNG interesting idea
 
I've been reading (a dangerous pastime I know), and I read that there are eight variances on xorshift generators,(plus a few redundant ones) i.e. a1 is x ^= ...
[2 replies] Last: Plus or star refers to advanced versions of the basic generator, basic... (by DarkLightHitomi)
When to use class and when functions?
 
When I want to solve a programming solution, when should I use class and when should I use function? In C++ are there any standards for this?
[3 replies] Last: thanks, it seems i need to use function for this problem I got..its ab... (by csstudent123)
qsort
 
Hello, How does this qsort function work? I don't understand the algorithm. void qsort(char *v , int i, int j); { int i, last; void swap(char...
[12 replies] Last: And from where does the error error: expected identifier or '(' { ^ ... (by MiiNiPaa)
by tsts
Solving sudoku and find all solutions
 
Hello everyone, I am new to C++ programming. I am trying to write some code to solve the sudoku using class, object and recursive search. Currently I only get t...
[1 reply] : The functions Solve and isSafe don't always return anything.... (by Peter87)
September 2015 Pages: 1... 678910... 21
  Archived months: [aug2015] [oct2015]

This is an archived page. To post a new message, go to the current page.