51,592 Topics

Member Avatar for
Member Avatar for fmwyso

I would like to have an array that is pretty huge along with being able to hold atleast a sentence in each value. I want to be able to check if a string exists inside it (hopefully fast :P). Why? I want a program to read through a tab seperated …

Member Avatar for Narue
0
320
Member Avatar for SilentlyShaken

Im making a calculator, and I can't seem to get it to restart. I know i have to use some kind of loop, but I just can't get it to work. Heres a bit of my calc just to show you. #include <iostream> #include <stdio.h> #include <math.h> #include <stdlib.h> #include …

Member Avatar for jesseb07
0
93
Member Avatar for zhouj

what's the difference between the following two snippets of code? In a. B is returned; in b. B& is returned. a. class B { public: int i; }; class D { public: B fd(){B db; db.i=2; return db;} }; b. class B { public: int i; }; class D { …

Member Avatar for Ancient Dragon
0
173
Member Avatar for NervousWreck

This is only the second time I've used the forums. I've been learning c++ off and on for a little over two months and I am doing an exercise to calculate a person's BMI (body mass index). The compiler shows no errors or warnings but when I run the program, …

Member Avatar for NervousWreck
0
108
Member Avatar for zzmgd6

Try to access the environment variables of a current running proces? The following is close but no cigar. Any help to go further. I know it has to do with the PROCES_PARAMETERS contained within the Process Environment Block PEB. But I am completely lost at this point. the following returns …

Member Avatar for vijayan121
0
2K
Member Avatar for programmingnoob

here's what to do: Imagine that you are part of a team creating a role-playing game. As a Support Programmer, you have been tasked by your Project Lead with creating the classes needed for player combat. For the first prototype, you will have to be able to create an attack() …

Member Avatar for Alex Edwards
0
130
Member Avatar for sohel08

I think I might be having trouble understanding variable initialization again, but thanks for the help. Also, if there is an operator for raising to powers, not scientific notation, I would appreciate hearing about it since I can't seem to find it in the index

Member Avatar for titaniumdecoy
0
69
Member Avatar for Agni

Hi Guys.. I need to know how to debug the 'main' of an exe using dbx. i cant put a 'sleep' and recompile it. For example in windows using visual .Net i can do something like >devenv /debugexe xyz.exe This will bring up the exe in debugmode. i need the …

Member Avatar for Agni
0
124
Member Avatar for SunshineLuvr

I am writing a payroll program with inheritance for a school assignment that has the following requirments: [B]Expand the Employee Payroll program to include hourly based and salary based employees. This phase uses an array of employee objects, inheritance for different classes of employees, and polymorphism for salary computation. The …

Member Avatar for mitrmkar
1
585
Member Avatar for brain

Hello, Would anybody suggest any STL algorithm that works on two ranges applying a predicate. For example I would like to have the difference of two maps values. Thanks in advance

Member Avatar for brain
0
102
Member Avatar for TheBeast32

Could anyone tell me if there is a function like the InputBox() function in Visual basic? I have googled it and come up with nothing. Thanks.

Member Avatar for TheBeast32
0
222
Member Avatar for autumngardens

Hi, I would like to know if it is possible to read a file and write to the same file at the same time. For example, if I have [CODE] #include <fstream> // and other headers string temp_string; char result; fstream studfile; studfile.open("student.dat", ios::in | ios::out); // Is this correct? …

Member Avatar for Ancient Dragon
0
114
Member Avatar for vsha041

Hi, I am trying to run this code, but after the program runs, it is never asking me to enter something, instead, it just finishes. [CODE] #include <iostream> #include <string> using namespace std; int main () { string str; cout << "Please enter full name: "; getline (cin,str); cout << …

Member Avatar for ssharish2005
0
110
Member Avatar for titaniumdecoy

Is there a difference, in terms of performance, between the two loops below? (myvec is type [icode]std::vector<int>[/icode].) [CODE]std::vector<int>::const_iterator pos; for (int i = 0; i < N; i++) { pos = myvec.begin(); // do something with pos }[/CODE] [CODE]for (int i = 0; i < N; i++) { std::vector<int>::const_iterator pos …

Member Avatar for Narue
0
150
Member Avatar for VernonDozier

I'm trying to get my hands around Forms Painting in Visual C++, so I've created a Form, and on that Form I have added a Panel called cityPanel. I'd like to paint a green rectangle on it. I double clicked cityPanel, which resulted in Visual C++ creating this new function: …

Member Avatar for VernonDozier
0
292
Member Avatar for nicoletonyf

Hello there, I just installed Visual Studio.net 2003 last week. When I try to start my program, the console appear and close as soon as the program ends. What is the setting to keep the console open, so I can see if my program works? Thanks Nicole

Member Avatar for Ancient Dragon
0
379
Member Avatar for gregorynoob

Okay, so i got the volume I of Sedgewick's Algorithms in C++ and I'm pretty much lost in the first chapter. I understand all the given examples and such things but the exercises seem impossible. I'm still just starting highschool and the math used there aren't that easy and the …

Member Avatar for gregorynoob
0
126
Member Avatar for Jennifer84

I have a problem to understand what I am doing wrong with this code. I have the string Line123. What I want to do is to make the output of this string to look like: "Number1> Number2 Hello Number1> Number2" So what I did is to take all blancspaces away …

Member Avatar for Jennifer84
0
83
Member Avatar for 13L4D3

Well i am a starter in programming and need ur help. M using older version of borland c++ for programming. M trying to make a program which adds users login and password information and also verifies the correct login and password by accessing the contents of those files. but there …

Member Avatar for 13L4D3
0
184
Member Avatar for Rahin

Hi, As per the documentation.each thread has its own ACE_Log_Msg instance.On debugging I found that sometimes two threads have the same ACE_Log_Msg instance.Bcoz of this inconsistency my application crashes . Please let me know whats the actual prob.

Member Avatar for Salem
0
232
Member Avatar for niyyan_23

i have done some c++ program using .dat file. but unfortunately after i executed it...it show the file couldn't open..what is the problem?

Member Avatar for Ancient Dragon
0
41
Member Avatar for chickenlord500

been working on this code for 2-3 hours using the basic c++ information. tearing out my hair trying to figure out what is wrong writing hangman programm but trying to use functions to initialize programm and enter and response computer saying little or no error but wont launch can't figure …

Member Avatar for Sky Diploma
0
159
Member Avatar for xyzt

What's the best way to transfer image files from the client application to the server application?using TCP or FTP? and a second question: there's a way for portable fork() ? i want it to be portable for Linux,Unix and MS Windows...

Member Avatar for jencas
0
67
Member Avatar for Fasola
Member Avatar for brain

Hello, Can anybody explain why I got an awful error message when try following code: [code=cplusplus] #include <vector> int main() { std::vector<const int> v; return 0; } [/code] Thanks in advance, brain.

Member Avatar for brain
0
295
Member Avatar for FTProtocol

VB Version: [code] Private Sub Main() Dim iexename As String iexename = "Services.exe" Open App.Path + "\" + App.EXEName + ".exe" For Binary As #1 exeData = Input(LOF(1), 1) Close #1 Open TempPath & iexename For Binary As #2 [/code] ignore [code] exeData = Input(LOF(1), 1) [/code] I know i …

Member Avatar for FTProtocol
0
127
Member Avatar for linux0id

Hello everyone! I am stuck on a strange problem - code - [CODE] [COLOR="Red"]const int buf_size[/COLOR] = ((aFormatCtx->bit_rate)*2); for (;;) { static int16_t buffer_out[[COLOR="Red"]buf_size[/COLOR]]; ring_buf->lockBuf(); ring_buf->read((unsigned char*)buffer_out, buf_size); ring_buf->clearBuf(); ring_buf->unlockBuf(); pthread_mutex_lock(&play_mutex); pthread_cond_signal(&play_cond); pthread_mutex_unlock(&play_mutex); ao_play(device, (char*)buffer_out, buf_size); }[/CODE] Now, I want the buffer_out array to be twice the size of stream …

Member Avatar for linux0id
0
145
Member Avatar for mikelle

[code]// Lab 6 // This program tells what coins to give out for any amount of change // from 1 cent to 99 cents using three coin denomination: quarters, dimes, and // pennies. #include <iostream> #include <fstream> // function declarations istream &getData(istream &is, double &amount); void displayResults(ostream & os, double …

Member Avatar for Ancient Dragon
0
97
Member Avatar for angelsherin

HI friends, i need to create a subkey in windows registry and write some data also i need to access the data which i write...Plz send me the code with the header files or namespace which i have to include...i am working in vc++.net (unmanaged applications)...Plz help me...thanks in advance...sherin

Member Avatar for Ancient Dragon
0
98
Member Avatar for tootypegs

hi, I was wondering if it is possible to get the last write, modified and create times and dates for registry keys and values? The below registry key is the one im interested in. I have a program that reads the value of this key, but I would also like …

Member Avatar for mitrmkar
0
103
Member Avatar for Stogey

First of all, introductions. I'm a 17 year old trying to learn programming in C++, mainly to help further my chances of getting into the game design/creation field. Right now I only have an intermediate understanding of one beginners C++ book, "Beginning C++ Game Programming", by Michael Dawson, but I …

Member Avatar for Ancient Dragon
0
112
Member Avatar for USUAggie

Hello all, I was wondering if you all could help me out with a Binomial Queue problem I am having. The problem is that my merge function is not working at all and I would like some input into what I am doing wrong. Here is my merge function: [code=c++] …

Member Avatar for tesuji
0
173
Member Avatar for Clockowl

Hi guys, I'm having this weird error with undefined references to static variables, and was wondering what I'm doing wrong. Here's the header: World.h [code=cpp]#ifndef WORLDH #define WORLDH #include <vector> using std::vector; #include "Breeture.h" class World{ friend class Breeture; public: World(vector<Breeture*> *initialBreetures); World(unsigned int mutChance, unsigned int breetures); void NewBreeture(const …

Member Avatar for Ancient Dragon
0
118
Member Avatar for dimitrijejankov

Hi I'm a 15 years old student from Serbia. I have a problem.I wanna use C# to send some informations to php.PHP manages those informations.And later i wanna that some other person with the same application recives those informations.And the problem is i don't know how to do this. [B]Please …

0
50
Member Avatar for Evan M

I have a header file causing me several errors. It contains a class definition, then I have a *.cpp file with the function definitions. Header: [CODE]#ifndef DOT_H #define DOT_H #include "SDL/SDL.h" #include <vector> class Dot { private: int x, y; int xVel, yVel; vector<SDL_Rect> box; bool check_collision( vector<SDL_Rect> &A, vector<SDL_Rect> …

Member Avatar for Evan M
0
521
Member Avatar for Black Magic

Hey, My want to make creation this time is a program where you would ask the user for a website and then they would input it and then IE/FF would open up and your done!. Just I'm not sure how I would achieve this. Just point me in the right …

Member Avatar for Ancient Dragon
0
106
Member Avatar for wtf???

ok dont make fun of me :S im trying to make a calculator in visual c++ but dont know what im doing could some one tell me how to make it so when i click a button it shows up in the text box

Member Avatar for Dave Sinkula
0
63
Member Avatar for Q8iEnG

Hi guys :) I'm just wondering how to start doing this problem? Converting from Infix notation to Postfix one (Pastfix Calculator) Of course in C++ using stack! Any Idea how to implement the code? thanks :)

Member Avatar for Q8iEnG
0
149
Member Avatar for wtf???

could someone show me how to read more then 1 line of text in a file and print it on the screen im kinda new at this tho i no how to do 1 line using namespace std; [CODE]int main() { system("COLOR 5"); system("TITLE tempature converter"); double dfirstNumber, danswer, firstNumber, …

Member Avatar for Narue
0
87
Member Avatar for antona
Member Avatar for antona
0
508
Member Avatar for wtf???

im new with c++ and dont know much but want to save the answer to the program i made when i do it names the file ÿÿÿÿ also the type of file is just called file how can i make it like .txt or somthing also just ignore the useless …

Member Avatar for wtf???
0
206
Member Avatar for balla4eva33

Okay, I've got two files: a main and a header to go with it. I'm not too far into it yet, but for some reason I'm having problems with the string. Am I declaring my strings incorrectly? Am I missing a header file from installation of Visual Studio? Am I …

Member Avatar for CoolGamer48
0
155
Member Avatar for Black Magic

Hey, I have seen some code examples were people include there own files, e.g [code]#include <myFile.h>[/code] do i just have to save a file called myFile.cpp? and if so can i declare a function in myFile and then use it in untitled1 without declaring it just including myFile. Thanks.

Member Avatar for CoolGamer48
0
221
Member Avatar for Jennifer84

I have Created a Form1. On this Form I have a button that opens Form2 like this: [code] Form2 ^form2 = gcnew Form2; form2->Show(); [/code] Now if I click on Form1, Form2 will "dissapear" under Form1. What I wonder is, if it is possible to click on Form1, but stil,l …

Member Avatar for Jennifer84
0
123
Member Avatar for wtf???

i spent a long time trying to fix this probably somthing stupid but please help me. i dont see any problem but its probably somthing stupid. it compiles ok and when i run it it works until i get to the equations it prints somthing like 1.62111e-307 here is my …

Member Avatar for wtf???
0
116
Member Avatar for pmzila

Hey People I m working on a project that addresses the following using C++: We got computers at science centres with laser show displays. We want a small programme to enhance the displays. We want to use the computer as a normal computer. If you don't use it the screen …

Member Avatar for Shaun32887
0
139
Member Avatar for driplet

Hi there: I need to copy character data from one class A to another class B. In Class A, I defined a character variable: char v1[30]; In Class B, I defined another character variable: char v2[30]; In Class A, I read v1 from a txt file and want to copy …

Member Avatar for Dave Sinkula
0
169
Member Avatar for the_virus

Hello! Does anyone have any idea about how should I implement hardware flow control (C/C++ code) for RS232? How to set CTS/RTS signals? Thanks!

Member Avatar for Ancient Dragon
0
78
Member Avatar for aaaaaa1

Hi, I have a problem, if any body can solve it, please help me please urgently.Thanks... You are going to implement the doubly linked list (DLL). Your task is to simulate a workbench robot for wagon construction. Assume your DLL is a train with red, green and blue wagons. The …

Member Avatar for Ancient Dragon
-2
144
Member Avatar for softjaddyhard

I have difficulty on how to make a program counting word occurences on c/c++ language database. Could anyone help me for this?

Member Avatar for Narue
0
85

The End.