Beginners - December 2012

Pick random string from Array
#include <iostream> #include <stdlib.h> #include <time.h> int main () { srand ( time(NULL) ); //i...
[2 replies] Last: Never thought it was this simple, thought you had to at least use clas... (by dadrack)
Why does standard out print inf?
I am trying to print out the area of a circle of radius 5 with the following code. #include <ios...
[2 replies] Last: You area assigning the value of radius to itself. When the compiler b... (by pogrady)
by tilon
Hello,about addition...
Hello,When I enter the number a and b, it just prints the value of b and won't add a and b together ...
[2 replies] Last: It will produce fictitious results with c is equal to 50. Boundary co... (by Incis B)
Sorting? Or Searching (1,2,3,4,5,6,7)
So this is my code up until now. I want to put in a search option however I don't know what type of ...
[133 replies] Last: int x = array ; int i = top - 1; int j = bottom + 1; ... (by faieq92)
do while loop
Print the sequence using do while loop. * * * * * * * * * * * * * * * *
[4 replies] Last: That's not a do-while loop, though. (by Athar)
How do you tell a project to output things using cout to the command line? When I 'run' my project (...
[5 replies] Last: CTRL+F5 will run it without the debugger, and will hold the console op... (by Stewbond)
by Ch1156
How do i put a vector in a class?
I tried putting a vector in my class but it wont let me do it it keeps giving me errors. here is my ...
[10 replies] Last: In the constructor, you need nothing, it's a class and it gets automat... (by EssGeEich)
SDL Mob Class Remake
Well this is my remake of my last topic, which is buried under 100s of different topics now in the G...
[14 replies] Last: Oh :D Thanks!!! (by Fredbill 30)
by Aceix
Easy to solve problem about rand()
Why does this give me the same number every time? ie: 3 string fnRandom() { srand(NULL); ...
[6 replies] Last: Thanks for your help! It makes sense that it is not needed to call sra... (by Rayquaza4096)
dynamically allocating array
I still dont understand pointers and references really. I found this segment of code somewhere on th...
[8 replies] Last: Yeah, exactly, that's it! The second code also had a memory leak. (by EssGeEich)
Simple calender program.
I am a calender program which should look like this. S M Tu W Th F S 2 3 4 5 ...
[3 replies] Last: #include <iostream> #include <iomanip> using namespace std; //PROTO... (by princemoon)
wrong in sort function
Hi, This Program shows total salary for each employee but after sorting in sort function It shows du...
[8 replies] Last: Because you can't initialize it that way. May use strcpy() or make i... (by ne555)
help me with iterator declaration!
1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <sstream> ...
[4 replies] Last: [quote=cppreference] template<typename T> struct S { template<type... (by Catfish3)
I compile the following code, suggested by someone, but i get the following compilation error: s...
[4 replies] Last: @jinanzhaorenbo Because the comparison function is not supposed to mod... (by Peter87)
help me with functors
Hi, the following is my code, i have two questions: first, in line 7, why can't i make ba1 and ba...
[4 replies] Last: why must i put 'const' in this case? (by jinanzhaorenbo)
by DPA
Help Me!!!!!!!!!!
Dear All I am making a 2-player tic-tac-toe game in c++ (compiler: turbo c++ 3.0) but my code jus...
[6 replies] Last: no turbo c++ 3.0 does not support namespaces. I know that my compiler... (by DPA)
converting one type to another
i see numerous different ways of converting one type to another. static_cast<int>(some_float) will...
[6 replies] Last: well the str to char i used the same method as char to string char C... (by metulburr)
i/o problems
void SaveData(Details Data , int size){ ofstream DataSave("test.txt"); if( Datasave.is_open(...
[1 reply] : It doesn't know what the class "Details" is. Its not a predefined typ... (by pogrady)
Logical OR isn't working Properly
Hello (: I'm learning C++ obviously and my friend let me borrow his C++ book from school called "Beg...
[2 replies] Last: wow, simple fix. thanks a lot. I need to be more cautious of my errors... (by dValdriz)
by Kovs95
Fun with Functions
Write a function titled say_hello() that outputs to the screen "Hello" ★ Modify the function so t...
[11 replies] Last: Ah I used "cout << hello" before but I didn't have the loop right! Tha... (by Kovs95)
December 2012 Pages: 123... 64
  Archived months: [nov2012] [jan2013]

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