General C++ Programming - September 2011 (Page 15)

Key Presses?
 
How can I make it so the user doesn't have to press enter when entering something on a console program? Like for example, the program says "Press Q to quit", th...
[15 replies] Last: Thanks! (by closed account 967L1hU5)
Thining in C++ book and a guidline
 
Dear all, I read in end of Volume 1 of thinking C++ book (guidelines section): "Avoid the preprocessor. Always use const for value substitution and inlines f...
[5 replies] Last: Actually, the inline just tells your compiler that you want the fu... (by hanst99)
Interesting interview question yesterday
 
So interviewer says "I want you to write out a short function to read in 1 byte and put out how many bits are in it". Thoroughly confused I ask him to repeat. "...
[6 replies] Last: Interviewers often know less about the language than you do -- they go... (by Duthomhas)
Passing arguments to main using command line
 
Hey everyone, I am stuck in this whole concept of using the command line to pass arguments(or parameters, dont know which is the correct name) to main(). I ha...
[12 replies] Last: The command line interpreter has a history function. If you press up o... (by helios)
Win32 Programming
 
Ok so I want to get into DirectX/OpenGl but I would like some knowledge of Win32 first. Well I have searched everywhere for a decent tutorial but I cant find an...
[7 replies] Last: MSDN. Use it. Learn it. Love it. http://msdn.microsoft.com/en-us/libra... (by closed account DSLq5Di1)
getLine not declared in Ubuntu?
 
I'm running Ubuntu and compiling my programs with g++ at home and running Windows XP and compiling my programs with CodeWarrior at school. I've used getLine in ...
[2 replies] Last: Ha ha of course...I feel like an idiot. I DID know that, but for some ... (by NetHacker)
pointer array
 
Hello, I am having trouble swaping values in pointer array. here is my code void sort(int *list, int count){ int i; for (i...
[3 replies] Last: #include <stdlib.h> #include <stdio.h> #define SIZEOFARRAY(array, ty... (by naderST)
by scat95
How to get a character from a string and compare to another string.
 
Hello. I need to get a character from a string and see if it is same as any other letters. HEre is what I have. I m actually Java programmer))) Began to learn C...
[3 replies] Last: int count = 0; for(int i =0; i<str.length();i++){ if(str == 'e') ... (by naderST)
A Class that Creates Classes...?
 
Is it possible to write a class that will create classes? Broad question I know...
[8 replies] Last: An interesting read: (Meta-Object-Protocol) http://www.vollmann.ch/pu... (by closed account 3hM2Nwbp)
by cdd
Better seed for rand()?
 
Hi when ever i use random dont really get the random numbers i need. for example i am trying to simulate a dice roll with this function: int DiceRoll()...
[2 replies] Last: You should only call srand(time(0)) once at the beginning of your ... (by Galik)
A better macro to concat 2 strings with __COUNTER__
 
In C I am trying write a macro that will append __COUNTER__ to the end of a filename (before the file type). I have tried several things, and the only thing I c...
[4 replies] Last: Regardless, not every identifier will be taken. 17.4.3.2.1 is merely... (by helios)
Solved
 
Solved
[16 replies] Last: lol OP: Solved Athar: What's the question? OP: a Nisheeth: Wha... (by ne555)
by Soko
SEGSEV received in STL code t_splay()
 
Hello, I am receiving a segsev from the STL. Using gdb, here is the stack trace at the time of segsev: Program received signal SIGSEGV, Segmentation faul...
[11 replies] Last: I don't get it. The operation with objects or with pointers are concep... (by ne555)
Bit wise square rooting
 
Im trying to make a bitwise function that will return a number x square rooted, i have a solution but it isnt legal because i cant figure out how to do it witho...
[3 replies] Last: hmm ok ty Duoas ill try and see what i can figure it out with what you... (by sorthon123)
CS106B Stanford University (kinda like Riemann Sum)
 
Hi I was doing this exercise while back and now I want to complete it.Here is the original posts about this issues i posted while back. ccie007 (1) Jul 13, 2...
[4 replies] Last: Can anybody help me please? (by ccie007)
Question about functions
 
Hi everyone! I have the following problem: How can I write a function g that takes one parameter of type double, call it x, and returns a pointer to the foll...
[1 reply] : //requires C++11/0x support //requires <functional> std::function<do... (by hanst99)
Socket GET
 
Hey, I'm trying to return a websites (google) html. I've taken a few hints from the Microsoft winsock examples and come up with this: redacted ...
[1 reply] : Bump with new info. Ok, turns out I needed: htmlSend += "\r\n"; o... (by thetree)
Help with chars
 
Hello, i'm trying to make a text file based program and trying to store my data into files. While in progress i noticed that i can't store a sentence in my f...
[10 replies] Last: solved (by evaldaskowka)
How to get file from unknow folder?
 
currently i'm using VC++ 6.0. i have to search for the .txt file and get info inside the file. but i don't have the exact folder name for the .txt file. ...
[2 replies] Last: Standard C++ does not come with anything to easily interrogate filesys... (by Moschops)
Writing as separate header and main file
 
Hello, I am trying to learn C++ on my own.I came across this thread http://www.cplusplus.com/forum/beginner/3473/ and tried my hands on some of the problems.I w...
[8 replies] Last: I can't say any thing as bad practice in the above code (on the basis ... (by Nisheeth)
September 2011 Pages: 1... 1314151617... 31
  Archived months: [aug2011] [oct2011]

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