Beginners - February 2018 (Page 5)

by Dr4g
Problem with setw() and setfill('')
 
Hi, I'm new to C++ and can't figure this out. I'm struggling with setw() and setfill(''),so I would like to know is there a possible way of applying this forma...
[2 replies] Last: Thanks for the advice. (by Dr4g)
Can someone help debug this list sorting program?
 
I'm getting compilation errors relating to my list constructor and I'm not sure what's wrong. In defense of the rest of it, my teacher is probably the worst I'v...
[1 reply] : void select() that's a function called select that doesn't return a ... (by ne555)
Segfault i think?
 
I have some simple code that should in theory work, but for some reason it fails? Any ideas? void sleepLineGen(float sleeps, char buffer ) { strcpy(buffe...
[1 reply] : Post a testcase that does reproduce your issue. we need to be able to ... (by ne555)
by Neahle
How to run a while loop, while another function sleeps.
 
Hello, I want to know how to run a while loop in main, while another function is executing a task each 20 sec. Right now I have this code #include <i...
[6 replies] Last: I will look into some books and the tutorials on this site. Thanks a l... (by Neahle)
Why doesn't this work? (only like 20 lines of code)
 
Why doesn't this work? I get a error on the first line of the main function when I try to turn my class into a object called do #include <iostream> ...
[3 replies] Last: C ++ keywords - cppreference.com http://en.cppreference.com/w/cpp/keyw... (by closed account E0p9LyTq)
Removal of decimal place in float
 
I am trying to make a simple function that 'integrates' floats. Basically 0.3857 Becomes 3857. 2.45 becomes 245 and so on. But my code sometimes just goes mad ...
[1 reply] : The problem is that many numbers cannot be stored exactly as a floatin... (by Peter87)
by obao98
Help with calendar project
 
Hello. I'm a beginner, so I'm sorry if the the problem is ridiculous or easy to solve. I have to create a project for my CS124 class where I prompt the user for...
[5 replies] Last: I've checked many times, many different combinations of months and ye... (by jlb)
C++ versus BASIC
 
I've been following the excellent series of tutorials by Bucky Roberts and have now reached tutorial 36 (MD Array). I used to write in Basic a lo-o-ong time ago...
[no replies]
FILE IN OUT probelem
 
I printed out more than one name in each line, who can explain why it will be caused #include<stdio.h> int main(){ FILE *fp; int n,size=0,i=0,s; ...
[2 replies] Last: oh i am fking dump.Thank you bro (by toby1a05)
my program is crash
 
why my programm is die #include<stdio.h> #include<stdlib.h> typedef struct{ int *data; int size; }array; void array_inital(array *a){ a->size=0; a->data=N...
[3 replies] Last: thx bro!! (by toby1a05)
by jen400
Outputting a line N amount of times
 
Hi, so I am writing a program for one of my classes. I have to output the message "Happy-Birthday" N amount of times given the user's input. I have this titled ...
[2 replies] Last: awesome! Thanks! (by jen400)
Keeps returning 0
 
Keeps returning 0 and I'm not sure what to do #include <iostream> #include <fstream> #include <string> #include <iomanip> using namespace std; void di...
[3 replies] Last: void displayTeams(string); //function declaration void displayWorldS... (by Marcus Aseth)
nested for loops
 
When i get rid of the top for loop and replace 'i' with 7(7th row of the board), the program works correctly. Since i want to check every row i added the top fo...
[10 replies] Last: What you have in your code is for(int j=0;j<6;j++) which means yo... (by Marcus Aseth)
Finding a letter in a string array.
 
...
[1 reply] : first get a pointer to the beggining of a name, meaning run a while lo... (by Marcus Aseth)
Unable to pass struct variable to class function
 
Stumped. Trying to pass a struct variable to class member function. Get syntax error as the struct variable is not being passed to the class function. #inclu...
[2 replies] Last: Thank you very much!! (by togar4071)
C++
 
The Pythagorean theorem states that the sum of the squares of the sides of a right triangle is equal to the square of the hypotenuse. For example, if two side...
[6 replies] Last: ok thank you and sorry if my question is weird I am fairly new to prob... (by closed account iyvp92yv)
Need some help with a problem :).
 
I am going through Bjarne Stroustrup's book and I have encountered a problem that i cannot solve. I get a lot of errors. I know I messed it up. I would really a...
[2 replies] Last: I see three errors: 1)"dislike" vector need a terminating semicolon. ... (by Marcus Aseth)
by Cp9
Help with the program
 
Hello everyone. I trying to write a program where the user enters number and counter is moving by that. My problem is how to make a program not start from the v...
[1 reply] : Something along these lines, perhaps: #include <iostream> struct co... (by JLBorges)
by Fer123
Program that tells how many more gallons are needed to reach the destination
 
I'm making a program that tells the user how many galoons of fuel do you have to add to reach the destination but I don't know to do it because the values of th...
[3 replies] Last: It is still the same: If Volume is known and CarTank is known, then t... (by keskiverto)
Need help with coding quadratic formula
 
I'm trying to code a program in C++ to: ask for 3 integers, display them, and depending on the numbers, use the if code to output results. if the equation is...
[5 replies] Last: Thank you. The fixes worked perfectly. (by crackedice)
February 2018 Pages: 1... 34567... 28
  Archived months: [jan2018] [mar2018]

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