General C++ Programming - November 2012 (Page 33)

When it comes to information hiding does one use include.h or include.cpp in the main func?
 
I finally see the benefit of information hiding so I am trying to learn it. I have the header class, implementation class, and the main function setup correctly...
[3 replies] Last: I found my problem. I was compiling from a cpp file instead of compili... (by dtaqee88)
by raz23
Issue with array-based mergesort
 
.h file #include <iostream> #include <cassert> using namespace std; template <class Type> struct nodeType { Type info; nodeType<Type> *link; }; ...
[no replies]
by Aendax
Difficulties with Linked List assignment
 
In file "LinkedList.cpp", you are given a layout of singly linked list in C++, and a main function (for testing) as well. You are to complete the code and get i...
[no replies]
Array help
 
So I need to write a program that produces 10 random permutations of the numbers 1 to 10. My program only gives one line. I need ten. Help! #include <iost...
[1 reply] : this doesnt solve your problem, but why dont you use b = rand() % 10;... (by Darkmaster)
by SMA01
Structures, display message?
 
I need to write a program where a user can either enter 2 distances and the program will add these distances, or user can enter 1 distance and 1 time and then t...
[1 reply] : let the user select and read his input with std::cin (by Darkmaster)
by cten12
LED program in C++
 
Im running into some problems trying to write a program which takes accelerometer data and makes LEDs light up. There are 3 LED's, 1,2,3, and when the accelero...
[8 replies] Last: It's more of a new company I'm guessing. A knock off arduino. Most of ... (by cten12)
What is a good way of changing states in a game?
 
For instance, how do I go from the main menu screen to the instructions screen to the play screen??? I currently use bool variables but is there a better way? T...
[2 replies] Last: Hey sorry for the late reply but yeah I think I see what is going on. ... (by dtaqee88)
Can anyone help me about this program
 
Hello, everyone, I am new in learning C++. My professor assigns me to this. But I really have no ideas, please help. Thank you the one who help me. Mo...
[1 reply] : #include <iostream> #include <cstdlib> #include <ctime> using namesp... (by vlad from moscow)
C++ regular expression program
 
I compiled this program using g++4.7 -std=c++11. It compiles but won't run. Can you give me help to get this working? #include <iostream> #include <regex> ...
[3 replies] Last: Works with clang++ (prints "freind"), but to use regex with gcc, you'r... (by Cubbi)
Opening Multiple File
 
I am not sure if you can use for loop like this to pen multiple file array files. Can you please look and tell me is I am doing this right. //Opens the file...
[6 replies] Last: new and new allocate memory and construct objects. delete and delete ... (by cire)
by ctyne
Help with functions/displaying multiple objects.
 
When I try to run this program (what I have so far) it says that the program has stopped working and forces me to close. I'm trying to display 10 bmp objects. W...
[no replies]
Help using MinGW to compile a SFML project.
 
I'm trying to call g++.exe from MinGW to compile a SFML project, but I'm having problems with the linker. I'm not using an IDE, just Notepad++ and and .exe (so...
[6 replies] Last: Um... Nope. They all have libsfml- in front of them, I didn't rename... (by KyleMiles)
Help me convert decimal number to hexadecimal using string
 
I've a decimal number contained in a string and need to convert it to a hexadecimal number(as a string) without the use of atoi() or atol() ...
[9 replies] Last: Whoa! Man! Thanks a ton for the code! :) It worked!! :) (by SameerThigale)
by Ather
Trying to get array.max_size to work
 
I am working on a program to get the array.max_size fuction to work right. #include<iostream> //for input/output functions #include<array>// for array func...
[2 replies] Last: You are including <array> so I guess you want to use std::array instea... (by Peter87)
Graph Implementation
 
I have a a vector<vector<string>> which holds the value if Nodes and edges. i.e 1,2,1 // here 1 is starting node, 2 is ending node and 1 is weight 1,3,4 ....
[no replies]
Reading value from a file into vector<vector<int>>
 
I have a input file which has an integer seperated by comma across multiple lines. e.g - 1,2,3,4 2,3,4,5 4,5,6,7 I want to read those value and ...
[2 replies] Last: Thank you so much. Works Perfectly. I had seen many examples before th... (by DeerPark)
by alex00
Complete the code using questions 1-6
 
1. Define data structure: The structure for each company data block has the following members in the exact sequence (line 12): char name ; char street ; ...
[no replies]
How do i make a video game like skyrim?
 
i'm not talking about a basic game, i am talking about an open world RPG with dungeons and items and side quests but i don't know where to start i know the basi...
[3 replies] Last: Framework- thumbs up! This will get 4 stars in the Article section of ... (by Kart)
The great space.
 
So I got it to output correctly but I'm getting a huge space before it does. I got all the words to be there. But it's just that this space. Any ideas? The fil...
[1 reply] : Actually I think it's this else if( i % 10 == 0 ) cout<< endl << i... (by jlillie89)
guys please help
 
Using this formula. θ=〖sin〗^(-1) γ/a √(h^2+k^2+l^2 ) constant: a=5 γ=5.14 h, k, l range -6 to +6
[1 reply] : Is there a question? (by Moschops)
November 2012 Pages: 1... 3132333435... 51
  Archived months: [oct2012] [dec2012]

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