General C++ Programming - February 2011 (Page 9)

Best way to code piecewise step function?
 
Hello everyone, Trying to code f(x) = [1 for 0<=t<1/2; -1 for 1/2<=t<1; 0 otherwise]. I wrote: ...
[4 replies] Last: Thanks guys! I got it :) (by siegel14159265)
by joshky
64 vs 32 bit
 
If I upgrade from windows 32 bit to 64 bit will it change the portability of programs that I compile...
[3 replies] Last: Ok, I have never tried developing from win64 platform, but I want to c... (by simeonz)
by aj3423
read last 5 lines of a file using stl fstream
 
like the tail command on linux, is it possible to implement using c++ stl fstream? do a reverse...
[9 replies] Last: I thought that the standard defines fseek for text mode when used to s... (by simeonz)
Mutexes ~~lol~~
 
Just a quick question on mutexes (looked up the correct plural form, this is as close as it comes) ...
[7 replies] Last: Haha Ya got that =D (by ultifinitus)
by ferros
openCV cvMorphologyEx() problem
 
Can anyone please give me some idea on cvMorphologyEx() function? I am a new guy in programming and ...
[no replies]
by chess
Tic Tac toe
 
Hi I would like to write simple code for Tic-Tac toe that just checks the rows and columns and diag...
[2 replies] Last: Hey chess.... do you want your function jto simply check and decide a... (by mrahsanahmad)
How to set the delim character in cin.ignore() to anything?
 
cin.ignore( INT_MAX, 'w' ) //Do not continue until w is pressed cin.ignore( INT_MAX, '\n' ) //Do n...
[1 reply] : cin.get()? (by quirkyusername)
SDL Problems
 
Hey, I'm kind of new to SDl and I've been writing a couple of wrapping classes and for some reason m...
[5 replies] Last: dude, im writing a wrapper engine in SDL too, why are you locking, unl... (by Jaso333)
eval
 
I was just wondering - how would you make a function like Python's eval(), which solves an equation?...
[6 replies] Last: Indeed in the case of simple expression like this, one can use recursi... (by simeonz)
Installing a Compiler In Code::Blocks
 
I've downloaded the compiler for The D Language for Windows. Now that I have it, I don't know how to...
[1 reply] : Never mind, I've done it. (by closed account zb0S216C)
count keeping
 
Hi all, Can someone help me with the command to keep count of the guesses that the user makes and...
[4 replies] Last: i added the lines below and the program works now; Thanks u very much... (by akounga2000)
Set precision isn't working...why?
 
My set precision doesn't seem to be doing anything. I'm following an example I found here on the Ref...
[6 replies] Last: The reason for your problem is because without the "fixed" keyword, th... (by packetpirate)
Text Adventure Problems
 
So I've been having problems with the use of strings in my class. #include <iostream> #includ...
[2 replies] Last: Damn. Just had to switch the two around. Thanks a lot! ;] (by HeWasLikeAGhost)
array size
 
hey guys i am writing a program that has lots of arrays. is this syntax not correct?? new_coef...
[3 replies] Last: That syntax is fine. What are the possible values of i? (by rocketboy9000)
setting a range
 
hello! i am currently working on an array, and i want a user to only select between 1-50 (when in...
[2 replies] Last: do this: int i; do{ cin >> i; if(i<=50)break; else c... (by rocketboy9000)
Is it bad practice to have multiple return statements in a function or method?
 
will having multiple returns make it more unreadable in contrast to having just one return statement...
[6 replies] Last: I found this quote a long time ago: In languages with exceptions, ... (by PanGalactic)
Vector Strings- extracting particular strings
 
Hi,i have written a programme which asks the user to input a course name and a course code. The prog...
[1 reply] : replace cout << *iterator; with if( (*iterator) == '3' ) cout << *... (by hamsterman)
checking for file existence
 
I'm making files to store data for a game I'm making. Theres a box that is going to display all the ...
[5 replies] Last: Check out FindFirstFile/FindNextFile/FindClose (by kbw)
Confused on Subtracting from struct element
 
Hello, My program is supposed to read from the user a soda name, the price and the quantity. Then t...
[14 replies] Last: Edit: Figured it out: void transaction (Drink machine , int &numite... (by skatingrocker17)
Nested Vectors or ye olde error C2679
 
Hi, I'm writing a server software with an onboard database using MS VC++2008 Express. Right now,...
[2 replies] Last: Yes, that worked once I modified my accessor method a bit. strin... (by Austin Covello)
February 2011 Pages: 1... 7891011... 25
  Archived months: [jan2011] [mar2011]

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