Beginners - September 2017 (Page 6)

Segmetantion fault
 
Write your question here. So im writing a program where where i have to find how many rectangles exist in my array where if i have the number 1 then this i...
[4 replies] Last: Alright thank you very much i should just change my array from array ... (by lastchance)
moving elements in arrays
 
Anyone know how to take the first element in an array and move it to one spot behind end point? For example: '1234' take 1 and move it behind 4 --> '12341' Im ...
[1 reply] : Copy/move element: #include <iostream> #include <string> #include <al... (by JLBorges)
Trouble passing variables by reference. I think?
 
Hello all! As always, thanks in advance. Im trying to make a text based game in C++, attempting to store player data inside the Player class and modify it from ...
[4 replies] Last: Thank you jlb, figured out what I was doing wrong. Thank you Globalto... (by MoreUmph)
MIPS Assembly to C++ convert
 
I am doing book problem that wants translated MIPS assembly to matching C++ lines. it gives: k = $s0, A base address = $s7 addi $t0, $s7, 4 add #t1, ...
[6 replies] Last: Ha, yea. May have to do that when I get the chance. Yea... don't want ... (by sonar87)
by EJJG
Server: Need to have the Home_Page read an HTML file
 
#if defined(LINUX) || defined(SOLARIS) #include <sys/time.h> #endif #define BUFFSIZE 256 #define SERVER_NAME "CNAI Demo Web Server" #define ERROR_400 "...
[no replies]
by ncant
Censor Code not Compiling
 
Hello. I am writing a program that will read a text file containing "sensitive" words followed by a message, and will then censor any sentences containing a "se...
[1 reply] : Put the files back the way they were and make sure everything still ru... (by closed account 48T7M4Gy)
Program Design
 
I need to create a program design for a program that will read in data from a file, store it in a 2d array, rotate it right and left, and print both. I think I ...
[2 replies] Last: Andy, I did end up doing something similar to pseudo code just in a ... (by Rodr1697)
c++ code help
 
I have a problem with the output of my code again. This time it doesn't show negative loss. I'm supposed to input this values: Acme Software, Inc. 100 25 25 W...
[4 replies] Last: Thanks you! (by bal160730)
ArrayBag bagIntersection & bagDifference
 
Working on a problem and I'm currently stuck on the bagIntersection method. Here is essentially what I need to do: Create a 3rd ArrayBag object to contain t...
[3 replies] Last: I'm so sorry, my sugar has been off and my brain isn't functioning all... (by Duthomhas)
by chuvak
Issues passing a pointer pointing to a struct to a function
 
I am running into an issue that I cannot seem to resolve. My prototype functions are, void display(const Kingdom& pKingdom); void display(const Kingdom& pKi...
[10 replies] Last: I am deallocating memory to avoid memory leaks, hence the delete Ye... (by jlb)
Error Checking
 
I'm in my first semester of CS at school and we're starting off with C++. We've been doing projects and I've been able to puzzle my way through most of it. But ...
[1 reply] : Something like this, perhaps: #include <iostream> #include <cctype> ... (by JLBorges)
How to read lines from a fiile, then split each line into words without arrays? (1,2)
 
This may be a dumb question, but I am trying to figure out how I can read each line from a file, then split each line into words without the use of arrays. I n...
[31 replies] Last: Ok, the only problem that I am having now is how to implement a delete... (by Metalman488)
rates
 
this is what I have so far. #include <iostream> using namespace std; int main() { int RATE_KWHr = 9.92; // Rate of KWHr in 2001 int NEW_K...
[7 replies] Last: What we want to find out is, over the intervening 14 years, what is t... (by keskiverto)
by b1yku
question
 
when i type 8 and 22 or anything it wont comes up and disappear am i type something wrong? i suppose to have if it is 8 and 22 or 8 and 8 will come up 8 >...
[5 replies] Last: #include<iostream> using namespace std; int main(){ int number1; i... (by closed account 48T7M4Gy)
by samcro
Insurance Premium Calculator
 
C++ I'm tasked with an assignment to create an insurance premium calculator. I have built my code so far up to this point However, my code isn't working as in...
[1 reply] : A few things look like they need fixing. First, the declaration at li... (by Chervil)
Cmath cant open math.h
 
I was following an SDL tutorial, and it all was going okay up until I had to include some new directories in the SDL files regarding textures. After this, I got...
[8 replies] Last: Ah, I should have thought of that. (I had been under the assumption th... (by Duthomhas)
I/O, fstream error.
 
Hello, Could you help me fix it? I use Xcode on Mac. When I ender input, name and age, it saves in the .txt file only the first latter. Not all informat...
[5 replies] Last: You're welcome, @mynameisalexey. (by Chervil)
by Bopaki
Help me find a problem with this line: rev(s[1..s.length]);
 
I am struggling to understand RECURSION: This line is in this recursive function: void rev(string s) { if (!s.empty()) { rev(s[1..s.length]); ...
[1 reply] : #include <iostream> #include <string> void print_reverse( const std:... (by JLBorges)
Random Number (1,2)
 
How do I create a single random number that is either less than 0 or greater than 10? int x = rand() || rand() Something like this?
[22 replies] Last: #include <random> #include <utility> #include <limits> #include <iost... (by JLBorges)
Code review please.
 
My program is a guessing game where the user chooses a difficulty level and then is given a random number and must guess if the next number is higher or lower t...
[1 reply] : #include <iostream> #include <cstdlib> #include <ctime> int main() {... (by JLBorges)
September 2017 Pages: 1... 45678... 21
  Archived months: [aug2017] [oct2017]

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