Beginners - June 2013 (Page 6)

Why is the following code causing a memory leakage?
 
#include <iostream> using namespace std; class Base { public: Base() { } ~Base() { cout << "Base" << endl; } }; cla...
[11 replies] Last: [quote=vlad from moscow]Your example has nothing common with the discu... (by cire)
For statement
 
Hi there i would like to know why is there a for statement its the same as while statements.,right...are there advantages and disadvantages?thanks
[4 replies] Last: Thank you all.you have been a great help (by closed account EwCjE3v7)
filling a vector
 
Hello, I need to create a vector, and fill it with N many elements. But these elements inside the vector should be incremented, based on another variable, sa...
[5 replies] Last: All of the member functions are at the bottom of this page: http://www... (by MrHutch)
Executing Error
 
Hello! This program is supposed to calculate an estimation of e to the power of x, but as soon as you enter the value of x, nothing happens. The program does no...
[6 replies] Last: You did it almost exactly the way my teacher did it, great minds think... (by GoranGaming)
by Dick
Game Dev
 
I started reading "programming for dummies" yesterday and got through a little over 200 pages. I mostly began because I wanted to make a video game, like 9 mont...
[2 replies] Last: I'd model this by having a hierarchy of classes representing items. S... (by MikeyBoy)
Using funcions with dirfferent names
 
I was programming a "game" and i want to use funcions for the attacs of the different monsters. To make it easyer to program I want to create a funcion with the...
[6 replies] Last: std:: is a namespace. http://www.cplusplus.com/doc/tutorial/namespa... (by AbstractionAnon)
while(integer)
 
What does while(r) below mean? What is it testing? #include <iostream> using namespace std; int sgd(int m, int n){ int r=m%n; while(r){ ...
[2 replies] Last: Thanks. (by GoranGaming)
by anzhit
Check if palindrome
 
This sode just seems to return true always #include <iostream> #include <vector> using namespace std; vector<int> digits ; void digitExtract(int x) ...
[4 replies] Last: OK ty i always seem to make such stupid errors (by anzhit)
While loop
 
I was wondering why in my determine_teacher function the printf call executes twice every time I enter an invalid character? #include<stdio.h> /* for pr...
[1 reply] : It looks like when execution reaches line 51, scanf reads the newline ... (by Branflakes91093)
by anzhit
Semiprime
 
i had to make a program to print first 25 semiprimes i.e numbers which can be expressed as product of two primes (distinct or indistinct). My code seems fine b...
[14 replies] Last: do help me with the palindrome program i just posted its quite .. frus... (by anzhit)
Error with code (working with text files)
 
Okay, sorry if this is considered a duplicate but it is a different problem with the same code discussed in another thread. I have two problems: 1. my test fi...
[2 replies] Last: Well, that totally fixed my problem with having extra lines inputted a... (by kyiro37)
Drawing geometric objects running in batch mode
 
CANNOT use array, string, or voids. Design a C++ program that will draw a series of geometric objects. Each drawing must be appropriately labeled. The progra...
[no replies]
by ZeHgS
What if I don't know the size the array is going to have?
 
Hi guys! I have a quick question. What if I don't know the size the array I made is going to be and don't want to use vectors or write anything new, is it p...
[5 replies] Last: I meant at any time, Thumper! Got it, thank you both very much! (by ZeHgS)
C++ equivalent of Java packages
 
Hi all, I’ve been writing a few simple programs using Notepad++ and the MinGW compiler (I’ve noticed that many people use an IDE of some kind, but I’ve ...
[2 replies] Last: Maybe your compiling wrong? You could also try a back-slash. given t... (by Lowest0ne)
USING MALLOC
 
hi.. i am posting this thread because i hoping that somebody can help me about my problem. this freakn me out. i checked the code well and i got this 1 irritati...
[8 replies] Last: I change the extension to .c i don't have an error anymore. but when ... (by charmcaster2549)
How to call a function using an object created in a class
 
Here is my code that I am using in three separate files: //Header struct cheese { cheese(int number1 = 5, int number2 = 5); int getNumber1(void); ...
[1 reply] : The problem is since you are creating a cheese object called 'win' ins... (by Zhuge)
writing array in loop form getting extra values
 
Why do I get extra values when writing the code in a loop? I am not sure why I am getting 0.001 , 0.002, etc Also why is my setprecision not getting most of th...
[5 replies] Last: Thanks (by HSflower)
Programming question
 
I've been stuck working on this program and could really use some help. The program is supposed to be: Write a C++ program that inputs two integers then cal...
[5 replies] Last: A reference should do it. By using a reference you change the value of... (by closed account N36fSL3A)
need a way to use switch case
 
can I use a condition in a case such as...... switch (sqroo) case x<0 ; case x=0 ; case x>0 ; default in such a manner.............Write your que...
[4 replies] Last: The third if is unnecessary. If x != 0 and x not > 0, then x can on... (by AbstractionAnon)
Extrat bytes from file
 
Hi, I'm writing a simple program to extract the last X bytes/bits of a file. So, to test my program I use 4 files: image.jpg --> it is a image in jpg...
[2 replies] Last: cire, Thnak you so much! I did not do what u suggest. But your answer... (by joaodaniel)
June 2013 Pages: 1... 45678... 49
  Archived months: [may2013] [jul2013]

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