Beginners - May 2012 (Page 56)

Why do I get the same random number in 5000 calls?
 
Why do I get the same random number in this code? #include <iostream> #include <array> #include <stdlib.h> #include <time.h> //Probability function should r...
[2 replies] Last: Thanks so much for that well explained answer :-) (by waqqassheikh)
by R N
Help regarding reading a file into array
 
I need to read data from a file, write it to an array, and draw conclusions on that data. Here is what I have to do. =========================================...
[2 replies] Last: Well you could use something like this: ifstream read(name_deposit.t... (by uhraurhua)
by ldima
push_back single element in a vector of struct
 
Hello,i have a vector of struct, so defined struct Point{ int x,y; Point(int x,int y):x(x),y(y){}; } vector<Point> pts; now i want to insert e...
[9 replies] Last: ok thank you! (by ldima)
Vectors
 
HI, I'm working with vectors, but I don't understand it at all its all so confusing, I simply don't know how to use it =[. So what I'm working with is a txt fil...
[4 replies] Last: A header should look like this for example #pragma once #include <ve... (by codekiddy)
Quiz/Trivia Game Using Classes! Help needed!
 
Right down to the nitty-grity. I'm enrolled in a C++ course and we have a group project due Wednesday. We've been instructed to create a quiz show game that rea...
[7 replies] Last: ...odd. Some of the line numbers of the errors don't line up with the ... (by Albatross)
Trouble Understanding PARAMETERS of Void Functions
 
Please tell me what my n00b mistake is. :) I need to be able to use Void Functions to call upon this coding, for the int main()... But, I do not know what P...
[8 replies] Last: Bump BUmp BUMp BUMP (by BadProgrammerJoe)
pointers
 
Hi ive got a program with 2 Classes, Ship and Cell, both of which are in the namespace Battleships Ship has 3 members, name, length and hits. Cell has 2 mem...
[no replies]
What is the proper way to involve trig functions?
 
Hello, I am writing a code that will estimate an objects distance when launched from a canon at a set speed, with variable angle of canon and the what distanced...
[2 replies] Last: Wow, it's a shame how little things like that can cause a big issue. (by Antonio97)
Efficient algorithm for finding large prime factors
 
Ok so I kind of went all brute force with this problem, and it takes forever to find a result. I was wondering what all good algorithms and/or tricks there are ...
[5 replies] Last: That should be trivial. (It can be held in a std::uint_fast64_t). In ... (by JLBorges)
C++ Inline Assembly G++
 
I am working on a school project. I was given the code int MemCmp( char* mem1, char* mem2, int size ) 67 { 68 int result = -1; 69 70 // BEGIN inl...
[no replies]
Pointer problem
 
I am writing a program that has read into a file of list of presidents, lists and sorts them alphabetically, and has their corresponding chronological number. A...
[no replies]
question about pointer sintaxis
 
hello its my first post , i have some experience programming in java an c# but i need to learn c++ because im interested on dsp development and as far as i kno...
[3 replies] Last: i found the explanation in : http://www.eskimo.com/~scs/cclass/int/s... (by hexduhax)
Error, variable not being used?
 
This is for my assignment for a course, and I was wondering what is wrong with my variable total? Whenever I enter a order number, it saids total is being used ...
[7 replies] Last: NVM! I got it! Thanks so much for the recommendation on switches (by strupan)
Display array data like a table?
 
I need to display my data in a table type form. As it stands now, it lists the data but it isn't straight. Output as it stands now: STUDENT ID---NUMERIC GRA...
[5 replies] Last: You're welcome. I'm having trouble trying to get a card game working. ... (by mikebell)
Looking for feedback
 
Hello all, We just started learning about classes in class (no pun intended), and while I have a fairly good grasp of how to do everything, I'm positive ther...
[3 replies] Last: void coins::dispenseChange(coins buffer, coins& cash, coins returned,... (by Kazekan)
by h4344
Something Like Bukkit developing for C++?
 
Are there any communities that do things like Bukkit does for Minecraft with Java but with C++ (they make plugins for their server software)? I liked making plu...
[no replies]
by Rhys64
Troubleshooting
 
Hey i have been working on a program and i could use a little help with it. The program is rather simple it takes 10 points of user input places it in an array...
[1 reply] : #include <stdio.h> #include <iostream> //declare formal arguements h... (by ui uiho)
matrix of 2 * 2
 
//Matrix 2*2 #include <iostream.h> int main() { int i; int mat ; int matr ; for(i=0; i<2; i++) cout<<mat<<endl; cout<<matr<<endl; system("pause"); return 0; }...
[2 replies] Last: map <int,int> matrix; another way of doing things. also <iostream... (by ui uiho)
by dbk27
Multiple Functions in a program
 
#include <cstdlib> #include <iostream> using namespace std; struct daytemp { string name; double temp; }; double avgwval2(da...
[1 reply] : #include <cstdlib> #include <iostream> #include <string> //you should... (by ui uiho)
Trying to make LinkedList "copy-safe"
 
I'm trying to make a linked list I have created copy safe. This means that I'm trying to get a working copy constructor and assignment operator. I keep trying t...
[9 replies] Last: 1_ You are missing the point. You need to copy all the list, you know ... (by ne555)
May 2012 Pages: 1... 545556575859
  Archived months: [apr2012] [jun2012]

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