General C++ Programming - March 2012 (Page 16)

Element testing in array
 
Hello everyone ! I am having a problem where I have a vector and in some cases this vector is going to be checked in some positions that an element doesn't exi...
[3 replies] Last: Every element in a vector is defined. Use the at() member function ... (by Duthomhas)
Shared memory architecture - Global variables
 
I'm putting together a parallel program in pthreads. I'm still kind of new to c-syntax, but is it true that a variable declared outside main() is global? Or is ...
[8 replies] Last: L B - The whole point is to make it accessible. As long as I lock th... (by liquidfuzz)
Please Check my function code(it is not run)
 
#include<iostream.h> #include<conio.h> main() { void sum (int, int); clrscr(); sum(10,15); cout<<"ok"; } void sum (int x, int y) { int s; s=...
[2 replies] Last: For C++ I find this way nicer: #include <iostream> #include <conio.h... (by BHX)
Split strings
 
Hi,i am currently working at a list that can extract strings from a file,separate the information from the string using the delimiter "|" and put those pieces o...
[2 replies] Last: http://cplusplus.com/faq/sequences/strings/split/ (by Duthomhas)
Get rid of negative zero?
 
I'm using OpenGL and I have it set up so that there is a function which is basically the equivalent of the standard printf(), and in this function I needed to i...
[1 reply] : It is an artifact of how the FPU works. Don't worry about it. If you ... (by Duthomhas)
by ajac
string array to character array
 
how do i convert a string array to character array ? whats the meaning of this error "cannot convert `std::basic_string<char, std::char_traits<char>, std::al...
[5 replies] Last: oh great!!thanks people (by ajac)
making a new results file
 
I have written a program that sends the results to the screen but I need it to send the results to another file. I am not sure what I need to include in my pro...
[1 reply] : im not really good at this stuff, but i guees i can try to help you. ... (by even821)
any fast way to find the range?
 
I have bunch of coordinates stored in a vector as follows // the first number is for x coordinate and the second one is for y std::vector< pair<double, do...
[8 replies] Last: ne555, yes, that's what I am doing now. But the total number of points... (by kfc123456)
by Galapp
how do I identify if a string is a number and if it is, convert it to an int?
 
Hi, I have a simple program thats input regularly is numbers, however I need to add an option where if the user types "help" or "/h" or "?" the program will ...
[1 reply] : First question is what kind of numbers am I reading in? Next question... (by Azagaros)
by sisi
stl map iterator
 
Hi all, I'm very confused with a simple but not understandable segmentation fault in my code. I have something like this typedef std::map<std::string...
[6 replies] Last: Dear Disch, The code between line 6 and 13, that I have posted here, ... (by sisi)
Stuck on Integer/if else statements
 
hey all is anyone able to help me on this; Suppose a cuboid has three sides length, depth and height Write a C++ program that reads from keyboard these 3 sid...
[2 replies] Last: if(variable1 == variable2 || variable1 == variable3 || variable2 == v... (by oonej)
by mom930
Atm Statement
 
I try to do an Atm STatement But something is wrong and I don't know how to fix it can someone help me. class Accounts; Private: strin...
[1 reply] : [co de] "Please use code tags" [/co de] http://www.cplusplus.com/f... (by ne555)
Array reference problem
 
I'm not sure but i believe my problem comes from using an array. I input 5 scores for 20 students and then display their totalGPA but i keep getting infinite nu...
[2 replies] Last: thanks that worked, i knew it was something like that. thanks again (by Sspangler)
push_back to Multidimensional Vector
 
Hey guys I'm new here, hopefully ill be able to contribute in the future but I have a question at the moment. I'm programming a multidimensional vector and I'm ...
[2 replies] Last: Thanks alot, I understand the concept its just the syntax :) (by Richard Baron)
fstream "lame" problem
 
Hello guys, could anyone please tell me why this program is writing a 0 byte file and not the whole set of data in the vector? int main() { vecto...
[15 replies] Last: When a std::fstream object goes out of scope it flushes and closes. W... (by LB)
by ajac
file handling
 
how do i open and read a .txt file which is displayed in another .txt file using c++ ?
[10 replies] Last: i have a cobol program and there are around 3 functions in it..and th... (by kbw)
do while loop
 
I am asking the user to enter a number in the key board between 2 and 100 and if the user doesn't enter a number that is in range then ask the user to enter a n...
[8 replies] Last: thanks!! (by johnhuge)
tile based game engine? (1,2)
 
i want to eventually make a game engine/map editor for a 2d rpg game. but i want it to be tile based, but i am wondering how to do this? i have been looking at ...
[21 replies] Last: oh, sorry, i misunderstood you a bit then :P thanks for clearing it u... (by even821)
by S G H
Class Deriving
 
I am a bit inexpert with classes when it comes to Constructors. My problem is this: I create a GeneralClass class, and create a DerivedClass, derived from Gen...
[2 replies] Last: If you don't specify it yourself, the default constructor is called. ... (by S G H)
Email Validation
 
I have to write a program to validate an email address. To do this I have to use the following criteria: •The email address must start with a letter (no num...
[17 replies] Last: Aha, so i'll clearly stop posting code in this topic. (by S G H)
March 2012 Pages: 1... 1415161718... 49
  Archived months: [feb2012] [apr2012]

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