Beginners - April 2014 (Page 31)

Problem with listing files in a directory
 
I'm using this function to get a list of files and sub-directories void GetFilesInDirectory(std::vector<string> &out, const string &directory) { HANDLE dir;...
[1 reply] : Never mind, I was just being stupid and using cin instead of cin.getli... (by DrZoidberg)
Unexpected IF statement result
 
Write your question here. This is a simple program to calculate how much a person will be charged based on the the user-inputed: Start time (HH.MM) & number ...
[9 replies] Last: @kesk: I apologize if I overlooked the format. My mistake @donnie: I... (by nichalos82)
by toast9
mystery problem array size
 
there are three different possible sizes for the array 4, 6, or 8. For some reason 4 and 6 work, but not 8. Basically anything 8 and up doesn't work. Heres the ...
[4 replies] Last: There's no way that was the problem. The compiler sees "8" and "1+7" a... (by Duthomhas)
Defining a function
 
Hi everyone so I am studying for a test tomorrow and I am doing a sample test and it's asking me to define the functions. What does defining a function mean and...
[4 replies] Last: you call a function with the name of the function followed by (). i... (by CodeGoggles)
by Irhcsa
Please help me with this
 
I am trying to make a simple game. The part I'm struggling with is giving the player the option of choosing to go a certain direction. In my case it's someth...
[9 replies] Last: Thank you to Gawaine and firedraco. This was my first time posting for... (by Irhcsa)
mountain-shape of stars
 
How to write a program that print out a mountain-shape of stars. For example, if use input a 10, you will print out 10-line of stars, 1 in the first line, 2 in...
[3 replies] Last: You'd probably have a much easier time of it if you were to write your... (by Duthomhas)
Pass the information to function
 
Done!
[4 replies] Last: bumps? (by CodingisFun)
Operators - redefinition
 
//Hi! How would you redefine this operator to make it do exponential operations? //this is my attempt, that doesn't work! I admit: I have little experience in r...
[6 replies] Last: lol (by closed account jvqpDjzh)
Smallest value in string array
 
I need to find the index of the smallest value in a string array alphabetically. Here is what I have but this is not working. int smallest(const string...
[2 replies] Last: THANK YOU! (by jmo5262)
Bloodshed Dev-C++: Including *.OBJ
 
In my created project I got "IGEL1.OBJ" which I try to compile together with my main.c without using any of the object's functions. I have clicked "include i...
[5 replies] Last: Sorry, I haven't found an answer to this. (by Chervil)
by Matome
PrimeChecker.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
 
//File: PrimeChecker.cpp #include <iostream> #include <cmath> using namespace std; bool PrimeChecker (int n) { int i = 2; if (n != 1) { for (; i...
[1 reply] : Get rid of the else on line 22? (by cire)
by shyy
Help with operator overloading
 
Hi, I am in bit of a stump here. I am trying to get the parameters of a rectange (width and height) and with operator overloading create a function to have th...
[2 replies] Last: Thanks for your input, I solved it :) This is how my class is, more f... (by shyy)
by moot1
Help with calculator
 
How would i make it so where if the person enters 1 the program ends? #include <iostream> using namespace std; int main() { char operation; double n...
[1 reply] : Add another case label for '1' between lines 68 and 69? Also, use a... (by LB)
Counting consecutive strings in array
 
I need to count the number of consecutive strings in an array called source and print them out. Here is an example of the output. Enter 10 words: aa aa ...
[1 reply] : Line 8: Declaration of an array of strings that has no elements. Li... (by keskiverto)
Segmentation fault?
 
Every time I try to run this it just says segmentation fault and i'm not really sure what that is or how to fix it. #include <iostream> #include <ioman...
[2 replies] Last: Segfaults usually happen when you try to illegally access memory. Her... (by MrHutch)
Comprehension failure.
 
Hi all. I'm learning C++ with Jumping Into C++ by Alex Allain and one of the examples of nested loops is code for a multiplication table. I actually made my own...
[1 reply] : I've scratched my head at code for a lot longer than two hours, don't ... (by MrHutch)
Printing the elements of a matrix
 
hi guys im trying to write a code that reads from a text file the values Aij i,j= 1,2,3 for a matrix (3x3) I'm trying to write a code where the elements are pr...
[3 replies] Last: Simply add 1 at the time you print out the indexes. cout << "a[" <... (by AbstractionAnon)
Code Efficiency help!!! Please!!
 
I want my code to perform O(N), where N is the length of the longer string. Can you help me out? #include <iostream> #include <string> #include <vect...
[16 replies] Last: Can you make this code runnable? Because, I'm a beginner of c++ yet... (by kimss90)
Simple array question
 
Hi, as part of my computer science homework I have to edit this program so that it works as you'd expect. Originally there were 3 errors I was tasked to fix,...
[7 replies] Last: I seemed to have fixed it this way but I'm not sure if its really the... (by AbstractionAnon)
Declarations vs Definitions
 
Ok so i know what a declartion is its like int i; // We have declared a variable called i But what is a definition can you show me a simple ex...
[10 replies] Last: int i; - A definition which also serves as a declaration. int c=10;... (by cire)
April 2014 Pages: 1... 2930313233... 67
  Archived months: [mar2014] [may2014]

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