Beginners - November 2009 (Page 18)

need random numbers or a pause
 
I'm trying to make a game, and i;m having issues trying to get truly random number's everytime i use the function. i use rand() and srand(time(NULL)) functions...
[9 replies] Last: FYI, that's not an error, it's a warning. You can ignore it (since yo... (by firedraco)
by rafta
2D Arrays
 
I am getting confused on 2d arrays while calling them on functions. const int row =3; const int cols =7 void showArray(int , int) //prototype functio...
[5 replies] Last: basically, user enters food consumption for 3 monkeys for everyday of ... (by rafta)
by JRevor
How to return a const char*reference?
 
I want to return the pointer to the beginning of an array as a reference in a method. Something like this: (const char*)& funct (void); // This doesn't comp...
[3 replies] Last: thanks! (by JRevor)
by Keeley
Calculator Problems
 
Hey I just started learning C++ and I can't get this to work. //Keeley's Project 3 - Ocotober 11th 2009 //Calculator Revision - 1 #include <iostream> #...
[7 replies] Last: The switch/case/break method would be best here (by j3tt)
using class sets
 
I'm trying to figure out how to print my class i have here, but i keep getting errors (2 of them). I'm pretty sure i defined everything accordingly, and i am ...
[4 replies] Last: The types eg: int , char ... (by Bazzy)
Problem comparing Variables
 
#include <iostream> using namespace std; int number1(char,int); //My first function int number2(char,int);//My second function int result(int,int);//My T...
[2 replies] Last: Well, that's what the tutorial displayed. I simply copied the action i... (by Deathscreton)
Reading time, strings from text file and storing to vector
 
Basically as the title suggests. Basically, I have a text file (lyrics or subtitles, say) set out as so: 00:04:00 00:09:00 XXXXXXXXXXXXX Where the ints ar...
[3 replies] Last: for(int i=0; i <= lyrics.size(); i++){ remove the equals sign from t... (by Bazzy)
by wasabi
Copy Constructors
 
So, I'm currently completely over my head creating a program that is, well, completely over my head. However, I've been doing just fine (ish) until I suddenly g...
[7 replies] Last: This sort of problem (copying stuff from one place to another) cannot ... (by guestgulkan)
Passing structs
 
What I need to do, is for every line of my input (which is unknown until runtime), I need to create a struct and pass the struct to a list. To function to appen...
[7 replies] Last: Move to the next list node at each iteration of the loop (by Bazzy)
by mrkhtn
Coding sets
 
Hi all, I'm brand new to C++, done other OO programming such as Java but finding the step up a little complex. I'm currently writing code for a C++ class dec...
[1 reply] : ADT simply refers to a non-specific type. std::set is a container of ... (by jsmith)
Doubt with delete[]
 
Hi there, I'm writing a C++ app which deals with dynamic allocated memory, a matrix to be more specific. My real doubt is: when I use delete , it does dealloc...
[1 reply] : It will delete the first "row" only, e.g.: int** matrix = new in... (by firedraco)
char* argv[]
 
Hello everyone, I just need your help, I'm new with C++. And I have a question how could I extract from argv a char? I just have to call a program with some ar...
[3 replies] Last: Which sort of problem? Are you checking argc has the right value befo... (by Bazzy)
Input from file output to screen
 
I am using #include<fstream> and using file data.txt as input: ifstream in_stream; in_stream.open("file9.txt"); How do I output all its contents (regar...
[3 replies] Last: Do the same thing with in_stream.get(): cout << char ( in_stream.get(... (by Bazzy)
by zsukal
How to make and extract file in format .cab
 
Hello. I search information about library, whose I can use to make and extract file in format .cab in system Linux. If you have time write simple code, pleas...
[no replies]
Great Common Divisor Recursively
 
I need to make a header file and I made the code (i hope it's right!) for the main part. Prompt: The greatest common divisor of integers x and y is the large...
[2 replies] Last: With the template the code in your function won't change, it will work... (by Bazzy)
Class function
 
#include <iostream> #include <ctime> using namespace std; class Time { public: int hour; int minute; int second; int time; Time() { ...
[1 reply] : In the constructor: time = time(0); You have time function from c... (by Bazzy)
compiling ncurses on g++
 
I know for gcc I have to append -lncurses to link the library but for g++ how do I go about doing it?
[1 reply] : -lncurses gcc and g++ are just compilers. Options beginning with -l a... (by helios)
Is there a way to find the average of two floats while rounding to whole number?
 
It is not necessary to round to the nearest whole value, but I need something that allows me to take the average of two floats and comes up with a whole value t...
[15 replies] Last: The upper limit for a 32-bit float is 3.40282e+038. Half of that is 1.... (by helios)
by ripley
function returning field
 
Hello, how do I return variables from function, that has arguments? For example: word f(word a ) { word b ; for(int i= 0; i<5; i++) b = -a ; retu...
[6 replies] Last: ripley, your name is ripley. part of ripley's code: word f(word... (by herbert1910)
Homework advise needed please!
 
Hi guys im stuck with my homework again and looking for any help. Ill post up the instructions..I did step 1 except the bold part.. 1 Defining variables and ...
[1 reply] : it's asking you to manipulate the variables you have just read in from... (by TaikoDragon)
November 2009 Pages: 1... 1617181920... 25
  Archived months: [oct2009] [dec2009]

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