General C++ Programming - July 2012 (Page 12)

Drawing a Texture using a matrix (OpenGL)
 
I am trying to make a more basic version of tiny tanks using SDL and OpenGL. To draw the textures to the screen I am using glBindTexture using GL_QUADS. It uses...
[1 reply] : If you have two linear transformations (in your case are affine transf... (by helios)
by ostar2
xor encryption
 
Hello, I am trying to encrypt the output from a java application to store passwords any help would be greatly appreciated. #include <cstdio> #include <cstd...
[6 replies] Last: You have an example here if you use windows: http://msdn.microsoft.com... (by modoran)
Returning a Comparison value for Linear and Binary search problem
 
Ok, so my current issue with my code is that I cannot figure out how to properly output a comparison value, for how long it takes my program to find the number ...
[2 replies] Last: Thank you so much! This works perfectly. (by jm92590)
to_string() issues
 
I have been trying to convert an integer to a string, and I ran across the function to_string(). I tried to use it, but it doesn't recognize the command. This i...
[5 replies] Last: Use a stringstream, this will work in every compiler without any speci... (by modoran)
qwt or GNUplot or others...?
 
Hello all, I write because I like to know which library you use to plot your graphs usually in your programs. I do programs that calculations the evolution of d...
[no replies]
how to make long form of roman numerals???
 
i have long form packed down farely well. i just need the last 2 "nothing" and "imverytired" to be short form roman numerals. ie (long form: 524=DXXIIII) (short...
[1 reply] : also the **cout<<i<<"="<<nothing<<"="<<imverytired<<"="<<nothing<<"="<... (by tbaker530)
Linked List using only structs
 
I am trying to make a linked list using only structs. Thing is, I'm really bad at programming. And therefore I make ALOT of mistakes. If anyone has the patience...
[no replies]
Placing member function code for templated class in seperate source files
 
Hey everyone, I'm trying to write a templated class and place member function code outside of the class definition. I'm using Dev C++ with the gcc compiler. W...
[1 reply] : You can't. You have to put them all in the header file. As for your c... (by firedraco)
Whats the problem
 
I have recently tried to make a sieve for project Euler. it works for 10, but not for 2 million, please see if you can find the error: Sieve.cpp #include...
[2 replies] Last: 186240581510 for 2 m 4469579551475 for 10 m Sooo What are you exp... (by bmiller)
Safety of reading past end of file
 
I've googled around and didn't find the answer I'm looking for. appparently, eof() and feof() return EOF only if you have already attempted to read past the ...
[6 replies] Last: Your message makes me LOL!!! C++ is 100% bckward compatible with C, a... (by caibbor)
compare IP address against a range.
 
I have a list of IP addresses and subnet masks I need to compare an incoming client IP address and see if it lies within the ranges that I have stored in my ...
[1 reply] : If u have IP in the form 123.456.789 u can parse it into 3 parts and c... (by soranz)
C++0x/11 discussion thread
 
I'm not sure if this is the right section, but I thought I'd give it a go. Also, I'm not sure if this has been posted before as I've been inactive from this fo...
[12 replies] Last: @rapidcoder, Yea I have no experience with them, just read somewhere ... (by ResidentBiscuit)
Encryption Help
 
I have to write a code for the caesar cipher where you enter whether you want to decrypt or encrypt and then enter the key for how many spaces you want the char...
[3 replies] Last: U'r not getting any result because the variable set on line 40 never c... (by soranz)
addition of char?
 
Hi! I am trying to learn C++. I have a question about addition of addition of char. I have made a class called SuperInt. Look at the second last row. In order ...
[4 replies] Last: x = infinity don't think it's zero :P Anyways, if OP is still here, ... (by closed account o1vk4iN6)
by iMunk
Vector and Struct
 
Hi everyone, I need a good tutorial about the use and management the library vector within the struct. I need to specifically define a vector "m1" as a member o...
[1 reply] : Don't do this. The size of an array should be a compile time constant... (by kbw)
parallel OMP with many "new" operators
 
Hello All, I have a code that uses multi threads using OMP. However, Inside the code I allocate too many memory using "new". I know that the memory alloc...
[13 replies] Last: Do you mean the tcmalloc library there? Yes. (by modoran)
File Handling?
 
how can i get rid of constantly opening and closing file? while(1) { //open file //get key pressed //write it to file //close file please provi...
[9 replies] Last: Yes it works fine, i am thinking about flushing the stream after speci... (by sigmablack)
I Want to know why this happens with getch?!
 
Hey guys, this is my code ! #include <iostream> #include <stdio.h> using namespace std; int main() { cout << "What is your favourite number?"; cout <...
[2 replies] Last: signed int has limit -32767 to 32767 Unless, you are working on an a... (by viliml)
Best Search algorithm
 
Hi everyone, I have a unique case wherein i have list of devices(8 in mycase) and each device can have 4 possible states for each device and has 2 channels (4 ...
[1 reply] : What you have there is a list of priorities. All you need to do is ke... (by webJose)
by vrakas
C file I/O vs <fstream> (1,2)
 
Can someone please explain to me when using C FILE I/O is faster than using the C++ <fstream> library? Because it's a real headache trying both on every code an...
[27 replies] Last: Because ofstream bar = foo(args); looks better than ofstream bar; f... (by ne555)
July 2012 Pages: 1... 1011121314... 30
  Archived months: [jun2012] [aug2012]

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