Beginners - November 2016 (Page 5)

by cm123
having trouble, how would i loop this?
 
i'm having some trouble figuring out how to loop this... i would like to loop until the user enters a valid input when validating the inputs. please help!! than...
[1 reply] : 1. Global variables like const double PI should be declared outside ma... (by gunnerfunner)
Making a extremely simple Tile game, tearing my hair out
 
Hi, I've been trying to make a tile game using C++ for the past week. I thought that I could follow a game making tutorial using SDL2 on youtube, cannibalize...
[1 reply] : SDL2 should be fine for what you're trying to do. Note that Tutorials ... (by Peter87)
by mmgh
debugging segmentation fault with lldb
 
Hello, I wrote an MPI Master-Slave program and sometimes I get segmentation fault on one of the slave nodes. It does not happen all the time. For example if ...
[3 replies] Last: no, i believe it initialises the blocks of RAM where the variables are... (by Jaybob66)
Grade averaging calculator
 
I am writing this program for a project and I can not get this to run at all. It executes the first cout command and then the command prompt disappears. If any ...
[2 replies] Last: If you are using microsoft visual studio c++ then use system("pause") ... (by bird1234)
Printing from a specific point in a string and onwards
 
I'm using C and I was wondering how you could take a text and look for a specific character and start printing only from there. Here's my code. #include...
[2 replies] Last: strchr() will find the character and return a pointer to it. becaus... (by Jaybob66)
Printing a stack
 
Hello everyone. I am just started learning c++. In the code here, I try to print the stack, but getting a segmenmentation fault. Any help appreciated, thanks in...
[6 replies] Last: its printing the 4, followed by the address of the cout object, becau... (by Jaybob66)
Program Crash When I try to Find a Number in List
 
Everything in my code works except for the part when I try to find a number in the list. If I try to find a number that's not there when there's something in t...
[1 reply] : = is assignment operator and == is equality operator. It is ea... (by boost lexical cast)
Helppp with linked list in C++
 
Hey guys, i need help with my code. The program specification is to create a phone directory using linked list. i've done everything i know but the program sto...
[1 reply] : You never exit the switch instruction. You need to encase your switch ... (by Golden Lizard)
Which line of code is better?
 
Which code of line is better, and why? if ((i + 1) % 3 == 0) or if (i == 2 || i == 5)
[1 reply] : The two are not equivalent, are they? If i is guaranteed to be in ... (by JLBorges)
Error in Array
 
Enter score of 200 students.Each score is associated with and index number in the list. Calculate and display the average score, highest score and lowest score ...
[6 replies] Last: @Chervil. Thank you very much! that was really a good explanation and ... (by DesmondLee)
Help! database return function
 
hi! I need help I'm not sure what did I do wrong for this program. I get errors on the compiler. please help me! this is the error: Pokemon.cpp: In function 'M...
[1 reply] : Functions attackMove(), healMove() return Move objects but there is no... (by gunnerfunner)
tic tac toe board into an array is not perfect!
 
Write your question here. My problem is why the my tictac toe board canĀ“t looks like the original file. The input file is: X O . . . . . X . This is the s...
[no replies]
Array Segmentation Fault char vs int
 
Hi All, Little bit of a weird thing happening here, Curious why this works: char GameBoard ; for (int i =0; i <= ROWS; i++) { ...
[4 replies] Last: I think that you need to share you output expected to have more idea o... (by kevinros)
by kmce
getline function no instance of overload function
 
Solved the problem
[no replies]
Reading file to Vector
 
Hello, im having trouble reading the text file to vector. And writing what is read into another file. Can someone help. Thanks. As of now, it only reads the fi...
[8 replies] Last: Thank you. i figured it out. It was the loop. Thank you. (by anpkcpsc)
I honestly don't understand this insanely-fast efficient prime
 
I have come across this piece of code and the second method (Efficient Prime) finds insanely fast, even it is much longer than the first version (Classic Prime)...
[2 replies] Last: Also, I try removing this line : isPrime(N); This allows the ef... (by integralfx)
Pointer-to-obect error//(int[int]) error
 
My code will compile and put the numbers in order but I getting errors on all the letters that are in the arrays. How do I get rid of this? Thank you. #...
[4 replies] Last: Thank you it worked. xxxxxxxxxxxxxxxxxxxxxxx Actually when I tried it... (by AchillesO23)
by noodel
string stuff
 
Hello. So I need to execute a word thats given, but letters have to change their places, 1st letter with 2nd, 3rd one with 4th one... I think I need one more va...
[2 replies] Last: Actually the program will take care of whitespace itself, we don't nee... (by gunnerfunner)
C to C++
 
Hello i need to change this line code from c to c++ but i dont know how int main(){ int k = 0; string text; using namespace std; cout<<"text...
[2 replies] Last: thanks, i use getline(std::istream, &text); (by Hanager)
digit count of number as lambda
 
Is it possible to make the function below into a lambda? int digit_count(int number) { int digits = 0; if (number < 0) digits = 1; // remove this ...
[1 reply] : As far as I know, you can turn pretty much any function into a lambda.... (by integralfx)
November 2016 Pages: 1... 34567... 44
  Archived months: [oct2016] [dec2016]

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