Beginners - July 2011 (Page 13)

I have a question
 
This is probably a stupid question, and it's probably been asked before, but can you have an if statement within an if statement?
[2 replies] Last: Thanks for answering. (by ziodice)
how i write .h file for .cpp?
 
how i write fix2float.h for this program? ------------------------------------------------------------------------------- main.cpp #include <iostream> ...
[5 replies] Last: thank you. in class we got the function fixtfloat.cpp already prepared... (by miki135)
Can someone help please i have written code for random number gen game but wont compile
 
Here is the code: #include <iostream> using namespace std; int main(void) { int Oliver = rand(); int User_guess; cout << "Guess my N...
[11 replies] Last: Hint: read the compile errors (by ne555)
by Hashtg
Vector iterator not decrementable
 
Hi, I am using a vector to store sprites for a simple game. The code is mostly from a tutorial on basic windows game programming, and this particular section i...
[16 replies] Last: Ok thanks Disch, that's sorted the problem out now. (by Hashtg)
Min and max values of array
 
the array is int i, min_val, max_val; int nums ; nums = 10; nums =18; nums =75; nums =0; nums =1; nums =56; nums =100;...
[6 replies] Last: [quote=Anon1010]And Ink2019, this is the arrays section of a tutorial.... (by lnk2019)
direct x 11 header file
 
Does anybody know where I can download the DirectX10/11 api like you have to do for Open GL? Coming from Open GL, I learnt that you can download such a heade...
[3 replies] Last: thanks. BTW can you recommend the best tutorials on it? (by Blessman11)
by Ahmed1
deleting elements while iterating through a list
 
Hi there, I'm currently working on a small broject which is about providing flexible download service. Basically, I read the info from a csv file and put it in...
[2 replies] Last: that worked totally fine, thank you very much sir (by Ahmed1)
averaging function
 
ok this program is meant to calculate an average from a list of "user defined values " inputed untill the user inputs 0; its saposto use and call fucntions, glo...
[2 replies] Last: this is a great tip (by benram)
Problem with an equation.
 
Hello. Most of the information is in the code. And if you're wondering why I output it to the console window it's because I love watching my programs work. ...
[3 replies] Last: Ah! A switch statement. I feel silly for not thinking of that. Thank y... (by Cppcats)
Writing Two Dimensional Array to Binary File
 
I am trying to write a two dimensional array to a binary file and I can't figure out the correct syntax. So far I have: #include <iostream> #include <ioman...
[1 reply] : Either for( int i = 0; i < n; i++ ) for( int j = 0; j < n; j++ )... (by hamsterman)
Manipulator to not display a large number in scientific notation?
 
I'm wondering what manipulator makes the output not show a number, that has a length of 10, in scientific notation.
[1 reply] : std::fixed ? (by hamsterman)
Dumb 8 Problem using single array
 
Hi everyone. I have been trying to understand what is wrong with my program. It is the dumb 8 queens problem where we have to place 8 queens on a chess board wh...
[1 reply] : The loop has no reason to be infinite. It's just that 8 10 /2 cycles w... (by hamsterman)
Vector error? Freezes on arbitary index
 
I am having a problem which I've isolated to the following part of my code: while(!EventData.eof()) { while (!EventData.eof() && (event_number ==...
[1 reply] : Can't say. Post the whole code and the input file so that I can test i... (by hamsterman)
by rucafe
Loading a vector class
 
Here is what I have so far: #include "stdafx.h" #include <iostream> #include <iomanip> #include <fstream> #include <istream> #include <string> #includ...
[1 reply] : Like it says. energy_dep is a vector, while in energy_dep_sum you can ... (by hamsterman)
by mikeCC
Pointer/Array Question
 
Hey. I was given the following problem to work out: Assume the following integers are stored in an integer array: 2, 19, 22, 34, 55 , 89, 100, 201, 239, 397....
[1 reply] : The problem is that there can be only 10 elements in Array and when yo... (by hamsterman)
by mikeCC
Pointer Help
 
Hello, as an assignment I was given some code and asked to modify it to print the following concatenated array {'a', 'x', 'b', 'd', 'g', 'f', 'v', 't', 'r', 'k'...
[1 reply] : &a is the address of the first element of the array, which is the sam... (by hamsterman)
Generate Random List with no Repeat Values
 
Here's a question that I see lots of posts on. The posts that I have read tend to be mostly focused on efficiency at the expense of being quite confusing. L...
[2 replies] Last: Thanks very much. This is one of the posts that I looked at. Templat... (by joatmon)
Dynamic Class Object
 
I need to create a new class object that simulates a deck of cards. I've stripped out the entire code and am down to just this. I need to create an empty list ...
[2 replies] Last: Thanks! (by joatmon)
Trouble with class member functions
 
We're doing this project with simulating a game of cards. First step, deal a deck of cards. Mission accomplished. Where I am hung up is when I want to output...
[11 replies] Last: This was a good idea. I have everything set up, but now my output doe... (by joatmon)
Inserting a Node in a Linked List
 
I have a double linked list that currently consists of a single node (it's a string with "two" as its data). Now, I want to insert a new node at the front of t...
[1 reply] : Post some more code. How is head_ptr and tail_ptr declared? (by jsmith)
July 2011 Pages: 1... 1112131415... 54
  Archived months: [jun2011] [aug2011]

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