General C++ Programming - May 2012 (Page 9)

Roman numerals enum
 
I was just working on a short code that converts Roman numerals to arabic numbers. I use enum to record the values so I can easilly use logical operators for e...
[no replies]
by CaleyM
Working Outside of Functions
 
Is it invalid to define variables and use i/o outside of a function? When I tried compiling this it complains about all lines except the bold declarations: "do...
[5 replies] Last: You should show the exact text of error messages. (by vlad from moscow)
Generic function objects
 
I have created a comparator which defines "ascending" order for a custom class. This can be used with standard functions such as std::sort() and std::find(). No...
[5 replies] Last: @Layne a namespace using won't help: greater will look in std and will... (by Cubbi)
by Mastif
reading column by column
 
Hi, I would like to read word by word column by column from txt file. my db.txt file: 0.35 0.21 0.11 0.76 0.62 0.46 0.96 0.84 0.6800000000000001 0....
[3 replies] Last: Thanks, it is a good idea, but I have to read one element at time not ... (by Mastif)
Reading an in-memory file
 
I am trying to write a program that will re-organize the data of a file that has been loaded into memory. I already have the part of the program that will do...
[12 replies] Last: Allocate some memory big enough: char* someMemory = new char(theSize... (by Moschops)
Matrix
 
Hi i am trying to write a program that builds up matrices( without really using pointers) and i am using i stream and iostream. So when i ask my program to give...
[3 replies] Last: Please put your code between code syntax, and also provide your header... (by therockon7throw)
linked list system C++
 
Need to write a code in C++ for the following problem. In a Parking lot a car is parked and said to be "VIP" if have some fixed time for parking and then hav...
[1 reply] : First take a pin and a peace of paper, and make a mind-map how would y... (by therockon7throw)
C++ Win32 GUI
 
1. Are there any books that teach it? 2. I have used the CreateWindow(); function to create a text box, but is there any way to change the formatting of it? I ...
[2 replies] Last: Yeah I know, just using Win32 for some practice. I think I'm going to ... (by ben1996123)
C++ code for car parking system
 
I need Help in Writing a Program in C++ for car Parking system using queues ,In which any VIP car is given Priority.. The code should contain some simple gra...
[5 replies] Last: Here is the scenario i assume: U have a parking lot of fixed size say... (by SirSmilesaLot)
time functions
 
I am doing a program for my class. I need to calculate how long someone has been doing something since they started for example sleeping. It needs to take in ac...
[1 reply] : You can also use a time_t passed to localtime() to get a struct tm. Y... (by Texan40)
Given two strings, not necessarily of the same length, count the number of positions at which they differ.
 
Given two strings, not necessarily of the same length, count the number of positions at which they differ.
[5 replies] Last: @cubbi we have to count at how many positions the strings differ from ... (by kalicha)
by BKz
Windows Settings in Console Applications
 
Hi, I was wondering if anyone know if it's possible to change the windows property of a console application?. To be more specific: If you create a windows fo...
[1 reply] : You can use the STARTUPINFO structure to do those things before the co... (by Texan40)
Technical issue with exceptions -- throwing a char const *
 
Hi, This problem is blowing my mind. I can't figure out what I'm possibly doing wrong. Here's the code (version One): void Diminisher::loadResources() { ...
[3 replies] Last: [quote=SexyBachelor] "Are there good reasons to use std::exception ove... (by closed account zb0S216C)
by Jikax
color conversion
 
I have a 16 bit number which represents a temperature i want to convert this number to a rgb values ( 0-255 for Red green and blue ). red = hot green = n...
[9 replies] Last: Have you tried looking at how Direct3D computes their colours? #def... (by closed account zb0S216C)
Seg Fault problem with inFile.getline command
 
#include <iostream> #include <fstream> #include <string> #include <cstdlib> #include <iomanip> using namespace std; ifstream inFile( "textinput.txt", i...
[7 replies] Last: About the char *line. I was under the assumption you could use that a... (by S G H)
c++ Count the number of occurrences of sequences of N (acquired through user input) or more consecutive 'T's
 
Count the number of occurrences of sequences of N (acquired through user input) or more consecutive 'T's in a string consisting of the characters a,c,g, and t, ...
[8 replies] Last: @Cubbi Bravo. I like it. (by vlad from moscow)
sdl img loading problem
 
i cant seem to load a jpeg using sdl_img, and i cant figure out why. heres the code: tileset = IMG_Load ("tileset.jpeg"); if (tileset == NULL) return; ...
[6 replies] Last: What does IMG_GetError() return? (by Peter87)
by tarak
Reading data from a file into main
 
Hi, I need help with reading a file given to us into the main.cpp using a 2D array. The question is: Implementing a function to read in a map from a fil...
[8 replies] Last: You think this part's hard? Just wait until you get to the part where ... (by Doolittle)
how to create communication between two .exe ,both written in C++.net?
 
how to make communication between two different .exe,which are in two different servers? so that data from .exe A can be send and Viewed in .exe B.
[1 reply] : Using the network. http://en.wikipedia.org/wiki/Network_socket beej.u... (by Moschops)
Binary Search
 
Hello every body...i want to ask that whether if we can do binary search without using a function?? if it is possible then how can it be....and also which metho...
[3 replies] Last: right krakissi..........i dont want to use any function neither predef... (by awaise17)
May 2012 Pages: 1... 7891011... 41
  Archived months: [apr2012] [jun2012]

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