Beginners - January 2010 (Page 17)

is this code correct?
 
im trying to make random numbers and i was wondering if this code is right. include #include <ctime> #include <cstdlib> srand((unsigned)time(0)...
[6 replies] Last: if you mean rand() yea, you can have as many as you want.. However a f... (by gcampton)
comp
 
[13 replies] Last: lots of swearing and return abuse... blah blah read this... http://... (by gcampton)
returning the value of a string in a function
 
i need to return the value of a string and a integer in a function, but the compiler wont let me. i know why but i need a way to get around this. space1,2,3,...
[19 replies] Last: thanks for your advice everyone, ive got it to compile and run. but it... (by shadowvillian)
Reading from a file into a Struct
 
Hi, and thanks for looking. What I am trying to do is have a struct and read from a file and output it to screen and file. Here is the code (just really b...
[11 replies] Last: I want to thank all of you for the very fast tips and answer. I don't ... (by akumanight)
Separate Source File To More Than One.
 
Hello Everyone. I have been searching for a while about how to separate source file to more than one.I have read some tutorials but I'm really confused. I k...
[1 reply] : Why is everything undeclared? mymusic is defined in class.h? Can you... (by jsmith)
If statement Problem
 
I'm doing an exercise in a C++ Book that asks to code a program that will determine whether a character is a vowel. I cannot seem to figure out what the problem...
[5 replies] Last: also -- tere's no need for 'test' to be global here. Avoid globals.... (by Disch)
by Rox
The difference between reference and non-reference variables
 
I do not understand the difference between void change(int& x, int& y){ // with reference sign int tmp = x; x=y; y=tmp; } int main(int argc, char *argv...
[11 replies] Last: example of the code and output, non referenced and referenced /... (by BettyBoopTS)
FORZA 3 H-PATTERN GEAR SHIFTER
 
Forza 3 is a modern racing simulator title, exclusive to Microsoft's Xbox 360 gaming console. There's not currently much on the market at reasonable cost for co...
[4 replies] Last: Thanks for the feedback! (by Mr ASIO)
retrieving characters of string individually
 
#include <string> #include <iostream.h> main() { char a = "ab"; char b1 ; char b2 ; b1 = a ; b2 = a ; cout <<...
[7 replies] Last: okay thanks everybody. It was kind of a "duh" thing once I saw what I ... (by Crazyhat)
Class
 
Hellow World. Hey guys I just started programing about a week ago. I am teaching myself out of a few books from the local Lib. I am trying to under stand...
[3 replies] Last: not quite but that's an easy way to look at it :) TBH, don't get hu... (by gcampton)
by wasabi
Reading scientific notation as a float
 
I know how to display values in scientific notation ( printf("%e",a); or cout << scientific << a ), but how do you it the other way around? If you receive ...
[4 replies] Last: I feel like quite a fool right now. (by wasabi)
Prime Number Sieve* What's wrong?
 
I am working on the typical prime number problem, and have decided to tackle it using the sieve method. I came up tih this code and believe it should work, at t...
[6 replies] Last: Yeah, you're right. (by Bazzy)
Cant find my error
 
I messed up somewhere here. The program compiles but it always evaluates to 0. Im doing this for school. Its supposed to calculate apples and oranges from a gro...
[3 replies] Last: Good. I had a feeling that was messed up. (by tummychow)
Where to start, from the ground up
 
I'm sure you all get this sort of question a lot, and it must be annoying, but I've no where else to turn. I'm completely lost. I've finally decided to dedi...
[2 replies] Last: Eclipse is the best bet for cross platform. Eclipse is one of the most... (by tummychow)
Program for Palindrome
 
#include <iostream.h> #include<string.h> void main() { char str ; int len,i,j,flag=0; cout<<"\nEnter String: "; cin.getline(str,80); len=strle...
[2 replies] Last: <iostream.h> is not standard, use <iostream> and <cstring>. Avoid usi... (by R0mai)
by Aiyen
File I/O and Array problem
 
Hello all I am currently trying to learn the basics of C++ by converting one of my older fortran programs into c++, but I have hit a wall when it comes to h...
[4 replies] Last: It turns out it was painfully simple! i = 0 while(!Inputfile... (by Aiyen)
problem with console tic tac toe
 
hi im making tic tac toe and i have ran into a problem. after the space is set i want to put in the code for the computer generating a random number. if the spa...
[4 replies] Last: Use an array instead of spacex variables. http://www.cplusplus.com/doc... (by R0mai)
statistical functions in c++
 
Hello, In regard to my master thesis I must implement an option pricing model by means of c++. I was looking for statistical functions which can help me but ...
[3 replies] Last: I wish people would stop thinking that downloading a header file autom... (by chrisname)
by wasabi
Disabling the console
 
So, I've been working on a windowed program that really has no use for the "DOS" console since all data is shared via the windows. Is there a (simple) way of st...
[5 replies] Last: Sorry for bringing this thread back from the dead, but I just saw thes... (by wasabi)
Ouput to a list of numbered files
 
I'm trying to write a code that will output to a list of files text which is almost identical, apart from that file's number. In short, I need to write the f...
[5 replies] Last: For anyone who might find this useful (I know it's a template I'll use... (by JoeyJoeJoeJr)
January 2010 Pages: 1... 1516171819... 24
  Archived months: [dec2009] [feb2010]

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