Beginners - January 2014 (Page 31)

Program outputting <player> Wins two times instead of 1.
 
Can someone help me out? When Player x wins program says, X wins 2 times. I cant figure out why. #include <iostream> #include <string> #include <...
[4 replies] Last: I tried removing the spot_valido before the while loop and it still ou... (by yatch017)
Ray tracing
 
Hello, I am working on a ray tracer and am currently playing around with some code I found online to try to help me get to grips with how a ray tracer works....
[5 replies] Last: Thanks. This helped. (by maximus123)
Validating user input
 
Hello, I am in the process of learning about validating input so that when the user types in a word instead of an integer, the program doesn't crash. This is a ...
[2 replies] Last: lol wow, can't believe I didn't catch that, Thanks! (by bookLearnin)
Delete objects?
 
Hi, I'm trying to write a chess program (human v. human) and want to delete the pieces once they've been captured but I think I dont understand something correc...
[2 replies] Last: Drat. Well ok, I'll look into that. Thank you:) (by Nogroth)
LoadLibrary error
 
An error keeps coming. It compiles properly, when i run it an error that says "LoadLibrary failed" keeps coming, how do i make it work??? #include <stdio....
[no replies]
Vectors again :( (1,2)
 
Please can someone use vectors in a program and explain what the code does. I came here at an earlier time to get an explanation to it but didn't really underst...
[23 replies] Last: That's a good book, I have it too, along with The C Programming Langua... (by CplusplusAcolyte)
Tic Tac Toe Array
 
Hey. So i am doing my first game--tic tac toe. And it compiles and runs just fine. So i run it, it asks for an input for my first move, and then marks my answer...
[2 replies] Last: yeah, i thought about that but couldnt figure it out. ill research it ... (by josepho16)
by woohoo
Iterate through vectors
 
I'm trying to iterate through a vector of structs but I keep getting this error http://i41.tinypic.com/2nvrlza.png It works for the first one but after that i...
[4 replies] Last: Use the value returned by the container's insert() #include <iostr... (by JLBorges)
Count the number of text numbers in a txt file using c++..
 
the text file looks like: one hello hi twenty-five billion fifty maths three thousand and two output: count the number of text numbers: 4 please Give me codi...
[1 reply] : please Give me coding. ...you must try something out, bring the code... (by Aceix)
Header causing compile errors.
 
I'm working from the Bjarne Stroustrup Programming: Principles and Practice using C++ book. I've recently ran into a point in the book in which I must use the h...
[4 replies] Last: > Here is a image of some of the compile errors g++ foo.cpp 2> erro... (by ne555)
Help Modifying Tic Tac Toe
 
I am trying to make this Tic Tac Toe program so that it is always played against a computer. I need a rand() function limited between 1-8 to meet the criteria o...
[11 replies] Last: A good logic to follow for the AI is to perform these checks in this o... (by Manga)
by alsade
question about text fies
 
is ther a way to insert all the words from a text file into string array and the integers to int array? i tried somthing like: string line ; int arr i...
[no replies]
Initializing Structs in Linked List
 
Hello, I am building a linked list using structs, and I'm having a problem with the initialization. This is the code I wrote but, I don't know how to make it wo...
[1 reply] : Hey, I hope I'm not too late ;) //in main you let n point to a new ... (by Glandy)
what does mean
 
'->' What doeas mean Please give some examples. t->g
[3 replies] Last: Its is a dereferencing operator. You need to know pointers to understa... (by Stormboy)
Blinking and color
 
The output at the way bottom, there are a bunch of outputs I need them in color and blinking. When it says ON the color should be yellow and When it is OFF colo...
[7 replies] Last: For the blinking, you could even use SetConsoleTextAttribute to set ... (by TwilightSpectre)
Ranking alphabets
 
Hi, I'd like to ask if there is an efficient way to rank an alphanumberic word based on its ASCII number, and to place it in a vector? For example: m a t c...
[3 replies] Last: As DTS suggested, you probably want to hash the string. Here is a webs... (by Smac89)
Input a budget, output goods to buy so that the user will spend as much as possible
 
Hello and thank you for your time and patience to help me. I'm struggling with this problem and I really don't know where to start, please help me with the alg...
[8 replies] Last: Brute force is most probably not optimal, and although you might be ab... (by Mathhead200)
by Garion
Converting Bases
 
I was wondering about how this code snippet here worked. Does this take the hexadecimal number entered and convert / store it as binary in the int i then w...
[4 replies] Last: Thank you so much! I think this makes a little more sense now. (by Garion)
Functions
 
How would you use functions in a calculator program? I got the jumping into c++ book and i've met functions again. This time, i kinda understand it (this is t...
[8 replies] Last: No, its completely unrelated to your code. Here, rather than the array... (by TwilightSpectre)
Adding several numbers without a loop
 
Is there a shorter way I can add 6 numbers without using a loop? Here is my code: sum = 1 + 2 + 3 + 4 + 5 + 6; Yes, this is homework, but it is ...
[5 replies] Last: ^^^ That's just abstracting from the loop. lol (by IceThatJaw)
January 2014 Pages: 1... 2930313233... 44
  Archived months: [dec2013] [feb2014]

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