Beginners - August 2011 (Page 2)

Delete repeats from array
 
I'm working through Walt Savitch's Absolute C++ and an doing Programming Project 2 from Chapter 5 - "Arrays". The task is detailed below, but basically it is...
[no replies]
returning multiple variables from function
 
Hello, I'm trying to return two integers from a function, but I can't get it to work. Actually I want to do this for two chars (returning two filenames) but ...
[3 replies] Last: Another way (less suited to this application) is to return a pointer t... (by K R)
cout looping return functions
 
hey all, i'm having trouble with my code.... #include <iostream> using namespace std; /* complie using: g++ file.cpp -o file ./file */ int Bit(long x, ...
[3 replies] Last: ahaha, what an idiot! thanks dude! ok i switch the loop around as it... (by jaykob hxc)
Use of TWO cin.get()
 
Some IDEs close the window as soon as the program finishes execution, and some leave it open.To see the output, you must place some additional code at the end o...
[3 replies] Last: Also: http://www.cplusplus.com/articles/iw6AC542/ (by Duthomhas)
by zider
calculate overtime
 
when i enter 61 in Number of hours, it should give me 316 but it gives me 312. if u can please help me as im unable to solve it. thanx #include<iostre...
[3 replies] Last: You've simply got your algorithm wrong. Get number of hours. Subtr... (by Moschops)
by waso
Headers for namespace
 
Hello, I have probably a very easy question, which is if it is necessary any header in oder to be able to use a namespace created by myself. For example: ...
[2 replies] Last: Hi webJose, Thank you very much for your reply. Regards, waso (by waso)
by ilnara
check if the pointer is pointing to valid address
 
im trying to write a simple program which will ckeck through all data addresses in ram memory and tell us which addresses are free, which are not. if i have 1gb...
[10 replies] Last: ok thanks for all the support. i know i may give foolish questions but... (by ilnara)
by tonnot
How to copy-clone an object ?
 
I have a function that receives a object instance and I'd want to copy-clone to an independent inner object instance of the same class.? my_function(class_...
[5 replies] Last: You're still getting the object by value and not by reference. You ar... (by webJose)
pthread busy wait
 
Hi all, On recommendation from a friend, I recently compiled one of my multi-threaded code using busywaiting and it works significantly faster. However, I am no...
[2 replies] Last: Makes sense. I had mostly concluded something similar from what I had ... (by cpluplusrat)
by Tresky
Can't Figure Out How This Works
 
My friend wrote a program to write a sentence backwards when the user gives input. Neither one of us can figure out why this is working, but it works every time...
[9 replies] Last: After re-reading my previous post, I see how it might be misconstrued.... (by closed account 3hM2Nwbp)
by alhypo
Define non-const private static data member
 
I want a non-const private static data member with a default value like this: class Matrix { private: static bool in_error; //... }...
[2 replies] Last: I just figured it out. I forgot to put the class scope operator on one... (by alhypo)
SFML error?
 
Heres the code, I'm following the getting started tut on the sfml site #include <SFML/System.hpp> #include <iostream> using namespace std; using namespace...
[19 replies] Last: Cmake basically makes something that makes the libs for you. Like a ma... (by firedraco)
A question about if/else statements
 
Hello everyone, So I'm starting to learn how to use if/else, and while doing a practice program, i came across an error on my part where I tried to assign or...
[5 replies] Last: Oh ok, now i get it, thanks alot! (by enlightenMe)
Gui based unit test framework in cpp
 
Hi all, Does any one know of a gui interface for unit testing C++ code i.e a framework which will list all the classes and methods(like an IDE) and lets us i...
[12 replies] Last: I suppose that you want something for free? If you or your company is... (by kempofighter)
by Chathu
About DEV C++
 
Hi.... Does Anyone Know How To Open Header Files In DEV C++. It Is There In Visual C++. But How To Write The Code In A Header File In DEV C++ If It Doesn't Have...
[7 replies] Last: Creation of any type of file is usually found under the IDE file menu,... (by anonymous23323124)
Unresolved external symbol
 
I have downloaded CSimpleSocket library. Added directory, containing clsocket.lib in my project Library Directories, and clsocket.lib in Aditional Dependencies...
[2 replies] Last: Thanks. (by Scottas)
constructors and dynamic arrays
 
I have a 2 classes, class A and class B. Class A contains a pointer to a dynamically allocated array of class B's, created in Class A's constructor. I need to p...
[5 replies] Last: You can create a vector filled with copies of a particular element: v... (by Athar)
Should I learn the rest?
 
I want to move on from console to 2d game programming, but I know there are a million things I don't know about console. Should I wait and learn the rest? I'm s...
[17 replies] Last: heh... im just like you. i dont have money for educations aswell. but ... (by ilnara)
The greatest element of a set
 
I want to write out the greatest element of a set. I used this set<int> s; //.. do sth to add elements set<int>::iterator it=s.end(); if (s.empty()){ //.....
[2 replies] Last: Or equivalently ... cout << *s.rbegin(); (by andywestken)
How does this code look to you?
 
I know I don't have to keep typing std::cout or std::cin because I didn't use the "using namespace std;" at the beginning, but does it matter? I would also like...
[17 replies] Last: Note that using return EXIT_SUCCESS; and return EXIT_FAILURE; ... (by andywestken)
August 2011 Pages: 1234... 39
  Archived months: [jul2011] [sep2011]

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