Beginners - December 2013 (Page 10)

Hangman with functions
 
Hello fellow programmers! I have an exercise to make: I need to rewrite the Hangman game i have written here, but with functions. I need to include a function t...
[5 replies] Last: That worked. Thanks a lot!! Merry Christmas :) (by minuss273)
[SDL] undefined reference?
 
I have two functions: static void CRect_RenderRect(int x, int y, int w, int h, SDL_Surface* dst, Uint8 colorR, Uint8 colorG, Uint8 colorB); static void...
[1 reply] : It looks like the last type(bgColor's) isn't Uint32 but unsigned int..... (by MatthewRock)
Joining Strings or characters
 
Hi! I'm trying to join two letters together into 1 string. Basically, I'm trying to mock up a table in which a user puts in their full name and phone number...
[2 replies] Last: I did something sorta of similar which works by converting 1 char char... (by project science)
Help Me Please with My Currency Converter
 
I am a beginner in C++ so if I did anything wrong in this program, please explain it without mocking me. I wrote this program so that it could convert currency ...
[6 replies] Last: Here's another approach: #include <iostream> #include <map> using n... (by tipaye)
Getline not reading first line...
 
Write your question here. Hello, I am new here and new to C++. I am trying to read around 4,000 lines from a text file, each line holds a number starting at ...
[5 replies] Last: When in doubt, pipe output to a file ;) (by LB)
Changing Console Cursor
 
Write your question here. My Question is same as the title of thread... I'm making a game in C++ which look likes with that of PACMan I've coded it almost, b...
[2 replies] Last: There's also a way to alter the cursor size if it helps. The cursor si... (by CplusplusAcolyte)
by nir2
question about "strtok"
 
hi everyone. i learned how to use strtok from here: "http://www.cplusplus.com/reference/cstring/strtok/" in the example he means that the "brake" char can b...
[8 replies] Last: I don't quite get what you mean by "deleted what I already used", here... (by tipaye)
Hammurabi game display message function
 
need help with this code 3 of the values are inputting in the wrong place, what am i doing wrong it is outputting as: 1051001000120150020 ...
[2 replies] Last: I commented out cout << year << starved << immigrants << population <... (by closed account 30X1hbRD)
Array can't be initialized
 
int targetTerm; ... // find targetTerm const int arraySize = targetTerm + 1; unsigned fib = {0, 1, 2}; // ignore fib I encounter a compilation error, say...
[14 replies] Last: Thanks all for giving me so much information. (by Nikko YL)
how to input in cin.getline() using function
 
the problem is when it goto first name input it takes but next time its ignore it how to fix this its not finished but its making problem in taking name with s...
[1 reply] : There are two things first you are returning a local variable. The mem... (by codewalker)
Templates and polymorphism
 
Dear All, I am trying to use templates with polymorphism. I have written the following simple code, in which I instantiate 4 objects of the class component<T...
[6 replies] Last: Array of pointers, no difference. You're just holding pointers. Array... (by tipaye)
Switch-case VS if-else
 
Hi, When to use Switch-case statements over if-else and vice-versa?
[4 replies] Last: Not really. You use switch(case) and if(else) whenever you want, excep... (by MatthewRock)
trouble with array
 
I am having trouble with getting an array to work and I cant figure out why? I think that the global variables would be filled once I called the get_word functi...
[4 replies] Last: As a result, I learned that if I use a global and cast its type in fu... (by MikeyBoy)
A little help with static methods...
 
I am having an issue with static methods. I have created a class say named A. In A's header file I create a public static method named lets say get name. I a...
[1 reply] : Figured it out, gotta declare the bad boy in the .cpp/ Thanks for tho... (by Hambone)
by samo
2d array.. help
 
Write your question here. how to take out an array index permanently ?
[7 replies] Last: it'll not be accepted through while (true) statement , or any other st... (by samo)
by Veliko
How to маке 1 variable appropriate random element from array
 
Guys how can i make 1 variable appropriate random element from an array for example #nclude <iostream> using namespace std; int main () {int Deck ={2,2,2,2,...
[5 replies] Last: Yes it worked thanks a lot you helped me a lot :))) (by Veliko)
Has this happened to you :(
 
I've been learning C++ for a while now. My problem is i am having problems understanding anything after the "Switch" topic in the pdf tutorial of this site. I k...
[11 replies] Last: The easy way to think of switch statements is alot like glorified if/e... (by CplusplusAcolyte)
Stream errors
 
Hello. I made this program, but I don't know what is wrong: #include <fstream> #include <string> #include <sstream> using std::stringstream; using s...
[no replies]
by dino93
calculate
 
Write a program which enters the value of mileage in kilometers and then recalculates it in miles. conversion is as follows: 1 mile=1609.35 meters.
[5 replies] Last: Have you tried compiling and running it? (by Zhuge)
by dino93
find errors
 
#include "stdafx.h" #include<iostream> using namespace std; class A { double a; protected: double b; double volume(const double& c) { return a*b*...
[2 replies] Last: Got quite a few weird thing going on in your code so here is an exampl... (by mobotus)
December 2013 Pages: 1... 89101112... 69
  Archived months: [nov2013] [jan2014]

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