Beginners - May 2014 (Page 27)

not having to write in memory everytime a program starts?
 
Hi, I have a simple question. I have a program that requires writing a large amount of memory from a file into a vector, so everytime it starts it takes about ...
[3 replies] Last: Most of the time taken to populate your vector is the access times of... (by Codermik)
BST inorder traversing
 
Question :This is a code of inorder traversing in BST , the problem is i can implement code but i am not 100% sure how it works , Now my understanding is when...
[3 replies] Last: If you look at it in the flat way - each number is printed three times... (by JockX)
SDL
 
Hi guys, i am trying to write my first SDL programme. I am making use of two cpp files,a main.cpp a sdl.cpp and a header file. There seems to be no errors in th...
[2 replies] Last: wow what a silly mistake. thanks for that it works now :) (by yusufseedat)
Finding multiples of 7 in given number range
 
I have this assignment to write a program the asks the user to enter two numbers between 0 and 999 and then it will find all the multiples of seven in between t...
[12 replies] Last: This all just seems a crazy way to teach a student how to program in ... (by Codermik)
Project Euler #10
 
I was trying out project Euler today and I'm currently working on number 10. The link to the question is: http://projecteuler.net/problem=10. I tried the idea t...
[2 replies] Last: I'm new to vectors, so I made the mistake of preforming calculations w... (by Shadowwolf)
by ushu
Variable not being asigned well
 
Hi, I am kind of new in c++, all the problems I encountere I tried to solve them by reading webpages and posts in this forum, but I haven't been able to solve t...
[2 replies] Last: Thanks a lot for your help, I can't believe the error was s stupid, ho... (by ushu)
While loops
 
How do I get the loop to end when it either Hits 10 on the counter OR I say something other than Y(or y) while((program_counter < 10) %% (retry == 'Y...
[2 replies] Last: while(condition_is_true){do something; if(goal_achivied)do something t... (by Cienjz)
How can I make this brutally forced array output into for loop?
 
cout<<"CRAMER'S EQUATION IS: \n"; cout<<" "<<equation <<"x + "<<equation <<"y = "<<equation ; cout<<endl; cout<<" "<<equation <<"x + "<<eq...
[2 replies] Last: you can use loop for to output each element of array. But remember, to... (by Cienjz)
using the return function
 
What is the easiest way to return to a point in a program, such as...if I wanted to return to cout << how many people are in your family? int fam, age, aget...
[4 replies] Last: thank you for your time and for helping me. Much appreciated!! (by ImmaNewb)
How would I allow the user to input an equation
 
I've written a program that finds the max of a function. I now want to get rid of the equation y=x^2-7x-18 and replace it by y=fx, fx being an equation that the...
[3 replies] Last: are you sure you've written this sourcecode by yourself? it looks like... (by Cienjz)
by Light1
std::out of range...
 
When i run this program. It gives me this error: terminate called after throwing an instance of 'std::out of range' what<>: vector::_M_range_check Why it g...
[10 replies] Last: Softrix is correct. Line 78 should be <, not <=. Lets assume th... (by AbstractionAnon)
by Relit
Question about functions
 
So i'm trying to figure out the difference between a void function and a int function what is the difference? Also i'm going to have a few questions about struc...
[7 replies] Last: void function CAN'T return any value, but it can do anything. int/doub... (by Cienjz)
ascii art loop
 
i forgot how to make it loop... using while statement... there is alot more code but i couldnt add it all in here... #include <iomanip> #include <iostr...
[1 reply] : bool finished = false; do { // ... do your stuff, this wi... (by Codermik)
using point and click programs
 
Alright i know i have been told that a gui is for making like a program that allows you to point and click for something to happen but if that is a GUI what is ...
[3 replies] Last: Well, GDI (graphics device interface) is basically about drawing: li... (by coder777)
by lays
error: when I trying to accept a container type.
 
I wrote a template function which accepts a vector container type. But I meet compilation error. Where wrong. //header.h std::ostream& operator<<(std::...
[3 replies] Last: It works! Thank you. The problem is thtat I treat the template functio... (by lays)
Printing highest number in array.
 
Hi guys, I'm writing a function that is suppose to print out the biggest number in the array. I can get it to print it out, but then it prints at every loop....
[3 replies] Last: Your welcome :) (by Codermik)
Alphabetical characters. Help.
 
ok i am almost done with this program, but i am stuck, well sort of. i need help with compressing, i guess you can say, the program. examples of the program i ...
[1 reply] : http://www.cplusplus.com/reference/cctype/isalpha/ bool Valid = true... (by keskiverto)
Prime Optimization
 
I was writing a piece of code to find all primes in a certain number range, and I came up with this to check if a number was a prime. Now, it takes about 20 sec...
[1 reply] : One optimization for your code: cache the value of sqrt(num) so it is ... (by Smac89)
Using Arrays With Files! [Help] C++
 
I am Trying to make my program read 10 integers from a user-named file using arrays, but I encountered logic error because the calculations turns out to be wron...
[4 replies] Last: Great! Thanks!! lol its Cleaner now (by laidDogg)
Problem with outputs?
 
The program needs to read in two sorted arrays each of at most 10 positive integers - assume that the user follows directions and enters only positive integers ...
[3 replies] Last: Update: Found your problem. You were going out of bounds. Example: ... (by closed account j3Rz8vqX)
May 2014 Pages: 1... 2526272829... 55
  Archived months: [apr2014] [jun2014]

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