Beginners - May 2015 (Page 4)

by Erland
Knight's Tour Backtrack
 
Can you check this code? It's stuck in infinite loop. #include <iostream> using namespace std; int xs = {1, 2, 2, 1, -1, -2, -2, -1}; int ys = {-2,...
[no replies]
QT creator: write to text file without overwriting what is currently inside
 
I want to know how to write to a file but NOT overwrite what is in the file. I know when I'm not using QTcreator I would do this os.open(filename.c_str()...
[2 replies] Last: Thank you so much!!! I got it working by adding QFile::Append afte... (by liquifiednate)
Initialize Variable in Header File
 
I have a variable that needs to start with a default value. I have a function in the .cpp file for that header file that changes variable a with every run. Howe...
[2 replies] Last: I'm a bit unclear what you asking, but... If a header file is include... (by andywestken)
finding an average of an array
 
Hi, I'm trying to solve a problem: http://www.codeabbey.com/index/task_view/average-of-array. I'm pretty sure that my function is bad, but its my first time cre...
[7 replies] Last: I didn't know that the compiler truncates the numbers, everything is w... (by Whitehead)
Help with a project
 
Hey guys, I'm looking for some help with a project for work. Basically, I want to be able to enter a 4-5 digit number, grab information from excel spreadshe...
[1 reply] : I know this isnt what you asked... Just how I would do it. To get resu... (by SamuelAdams)
C++ Multiple Inheritance
 
I am currently stuck and I cannot get the setScore(numericScore) to recognize on PassFailExam.cpp . Any help toward a solution will be much appreciated. /...
[1 reply] : Careful with your use of terminology -- you are not using multiple inh... (by andywestken)
,
 
.....
[1 reply] : Formatting your code will make it more readable. How to use code tags... (by SamuelAdams)
Error Using FLTK and C++
 
Write your question here. Why am I getting this error message: 1>------ Build started: Project: C12Test, Configuration: Debug Win32 ------ 1> fltk.cpp 1>c:\u...
[5 replies] Last: I feel like kicking myself ... Don't! As you say, you're only huma... (by andywestken)
Problem with Do Loop
 
I'm writing a program that outputs a value based on a value the user inputs. For example, if the user inputs a value from 0 to 0.35, the program triples the va...
[2 replies] Last: Thank you so much, the program checks properly now. (by azns123)
C++ Derived Classes
 
I could really use some help, not sure where I have gone wrong. Thank you. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(...
[2 replies] Last: Thank you! (by tonester)
by koko82
Class instantiation, which is the best way and why?
 
Hi All, Just learning about classes and trying to understand the different ways you can create an object. It looks like from code you can do this 3 ways, is ...
[9 replies] Last: Thanks all for your help much appreciated. I will start to use the new... (by koko82)
Writing to an array using cin
 
Hi, I'm trying to use cin to write to an array and then simply output that array by passing it to a function. See below #include "stdafx.h" #include <...
[3 replies] Last: grrrr thank you! Stupid mistake! (by nathanc23)
ASCII to regular value
 
Hi I'm here trying to convert the letters of a name to its ASCII value and add them, if the final value is not (0,1,2,3,4,5,6,7,8,9,11 or 12) then I wanna add ...
[2 replies] Last: Use ajh32's code to get the number from the string. You can't do the ... (by dhayden)
2D arrays
 
so I'm supposed to output a table showing a multiplication table for 1-5 using a 2D array: 1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 4 8 12 ...
[2 replies] Last: Try this... #include <iostream> using namespace std; int main() {... (by PSYCHAMERON)
typedef array
 
Hi,, can i typedef array? typedef double account ; will this be like array of 4 doubles?
[2 replies] Last: Note that array typedefs are seen to be a bad idea (at least a bit evi... (by andywestken)
Can Someone look at my code? 2048 game.
 
#include <iostream> #include <conio.h> #include <vector> #include <cstdlib> #include <time.h> #include <windows.h> #include <algorithm> using ...
[1 reply] : at least ask a question, what do you want to know? oO So far I can onl... (by Gamer2015)
by MrAnts
Understanding of String.at() - '0';
 
Hi can anyone help me with this code? int day; day = (((int)UserInput.at(0) - '0') *10) + (int)UserInput.at(1) - '0'; I have no idea why does it ne...
[5 replies] Last: OMG thank you so much now I understand why we need to - '0' because 'z... (by MrAnts)
Tips/Improvement: File Parsing Program
 
I don't know if "parsing" is the right word, but this program is designed to get an input file "playlist.mbp" (musicbee playlist) and generate a simple M3U play...
[5 replies] Last: I don't know the MusicBee playlist file format (have you seen a spec f... (by andywestken)
How to call C# dll Methods and events inside C++/CLI
 
HI friends, i am new to C++ programming. now i trying to migrating C# library functios and \ events with in C++ application for that i have create one Wrapp...
[no replies]
Need help with output. Beginner at programming.
 
Hi I am new to this forum and also a beginner at programming. I just want to ask some help for those kind people out there about my code. I am getting an output...
[2 replies] Last: for (int exam=0 ; exam<=3 ; exam++) { // Insert code to ... (by closed account 48T7M4Gy)
May 2015 Pages: 123456... 40
  Archived months: [apr2015] [jun2015]

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