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

NEED HELP FAST
 
I need to know how to make one function that calls multiple functions. This is the code I have so far. //CS 575, Lab Exercise, Stefan Olarte #include <...
[1 reply] : string f(const string & s) { string result = removeSpaces(s); ... (by cire)
Manipulation of strings
 
Thanks to it being the flu season, I missed my programming class today. Our teacher posted an assignment online that is due in the next 2 hours and I need help....
[3 replies] Last: You have the return statement inside the loop so it only runs the firs... (by Peter87)
Writing a program that reads a list
 
The practice prompt is as follows: Write a program that reads the list /users/calendow/assignments/shortest-word and prints out the single shortest word in it...
[no replies]
by vinny1
bool functions
 
For the given input std::ifstream fin; // 'f'ile in - fin std::string filename = "fake.txt"; bool isOpen = GetInputFileStream(&fin, filename); std::cout << ...
[3 replies] Last: #include <iostream> #include <string> #include <fstream> bool file_e... (by JLBorges)
Programme problem. Clases, gets and sets.
 
Hey guys, i have this code but i can't make it work as i want. I can't get past "Enter name: " . I need some kind of solution, can anyone help me? #include <...
[2 replies] Last: Thank you for everything, it has been very useful. I have to say that... (by WareStrength)
by vinny1
My function isn't quite working
 
This function isn't quite working It should allow you to put text in a file, send the pointer back to 0, and overwrite whatever information was already there t...
[2 replies] Last: Also tellg, seekp and most other file position functions use a streamp... (by jlb)
Subtraction in a Linked List Calculator
 
My subtraction doesn't work. it gives me an illogical number that I can't identify how did it even appear. could someone see what is the mistake and tell me who...
[2 replies] Last: Try something easy like: 12 - 3 then 3 - 12. Maybe // Don't use th... (by histrungalot)
Trying to Call on an Array
 
solved
[3 replies] Last: FOUND THE PROBLEM BUT I DON'T KNOW WHY IT WORKS. I put lines 73 to... (by dualsymphony)
by bsc123
changing a char in a grid
 
I am making tic tac toe and I want to replace the numbers 1-9 with X's and O's. Is there a way I can do this with out printing the grid again. Thanks.
[no replies]
C2664 Error New to Arrays
 
ty
[2 replies] Last: Thanks man. Learned something new. I didn't know they had to be in ord... (by dualsymphony)
Can't stop this function once it's started?!?
 
void blink(unsigned int interval_msecs, std::atomic<bool>& keep_at_it) { while (keep_at_it) { std::cout << " (s) S...
[4 replies] Last: if (key == 's') { keep_blinking.store(fal... (by cire)
nested for loop literal problem
 
consider the following loop(s) for (int foo(0);foo<t_max;++foo) { for (int goo?;goo<t_max;++goo) { do stuff } do stuff } ...
[2 replies] Last: I had a bracket missing from the code that created errors with goo(foo... (by technologist)
by Cat32
Issues with constructors for class
 
I'm trying to write a program that simplifies fractions. The problems is that when I put in a denominator of 0, It's supposed to give an error message. I put it...
[1 reply] : Morning. It's because when you instantiate your Fraction you're callin... (by mutexe)
Segmentation fault
 
What's wrong with my code? Getting segmentation fault when trying to compile: #include <stdlib.h> #include <stdio.h> int values = { 40, 10, 10...
[1 reply] : Since you pass an array of ints to qsort you can and should cast it to... (by Thomas1965)
Count all characters appearing consecutively. OUTPUT: The number of characters appearing consecutively and the letters.
 
Can someone help me in my code? When I input Committee the output should be 3 mte and it is correct but when I input mmmmrrnzzz the output should be 4 mmrz inst...
[5 replies] Last: You are very welcome. (by Thomas1965)
Text file into arrays
 
Hello, So I have to write a program which reads the text files into the arrays, and then is able to use the students' data to sort, and calculate the averages,...
[1 reply] : First I would declare the arrays as in the instructions: Your progra... (by Thomas1965)
by bsc123
Replace char in grid
 
how can you replace a single character of a char grid. I am making tic tac toe and don't want to keep printing out the same grid. Can I a character with X/O. I ...
[no replies]
Need help with problem in my source code
 
Heres the code #include<iostream> #include<cmath> #include<string> #include<istream> #include<iomanip> using namespace std; struct Cargo { string label; ...
[no replies]
Using for loop variable when inner exception occurs
 
Hello, Is it correct to use a value of variable 'x' from the for loop inside catch if exception occurs inside the loop? Or how would you suggest to rewrite th...
[3 replies] Last: Yeah, that was a stupid question, I was too tired:) Rewrote it with wh... (by stridder)
C++11?
 
I was trying to compile some code with lambda functions using TDM-GCC and everytime I compile: 'g++ -std=c++11 hw8.cpp -o hw8.exe' the compiler slaps me with...
[2 replies] Last: alright it compiles now, but yeah it seems you have to enable c++11 in... (by omega4relay)
November 2015 Pages: 1... 678910... 26
  Archived months: [oct2015] [dec2015]

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