49,756 Topics

Member Avatar for
Member Avatar for abuaqrab

[code]#include <iostream> #include <fstream> //#include <scientific> using namespace std; main () { ifstream in; ifstream in1; ofstream out; out.open("electrons.dat"); double x,y,z,electronenergydeposit,gammaenergy; int nlines = 0,nlines1=0,electronparent,electrontrack,electronevent,electronevent0=-1,gammaevent=-1,gammatrack,gammaparent,stepNo,process,creatNum; long pos, poscurrentevent=0, posnextevent=-1; // TFile *f = new TFile("Depos.root","RECREATE"); // TFile *f1 = new TFile("gammas.root","RECREATE"); in.open("Depos.dat"); in1.open("gammas.dat"); while (!in.eof()) { in>>electronevent>>x>>y>>z>>electronparent>>electrontrack>>electronenergydeposit; if (electronevent==electronevent0) in1.seekg(poscurrentevent); …

Member Avatar for Ancient Dragon
-3
102
Member Avatar for guest7

Hi, I am using the following code to convert character array in file to integer. However, the problem is that there is only one place in the file where it does not convert the character array to integer correctly. Since my code is big, i am pasting the most relevant …

Member Avatar for Ancient Dragon
0
142
Member Avatar for Valaraukar

Hi, I'm writing a program in C++/OpenGL as part of a university assignment but I am having difficulty using the function glBindTexture to bind my loaded textures onto the models that I load in and render. I can actually wrap the texture around my 3D model no problem but I …

Member Avatar for Valaraukar
0
251
Member Avatar for Waylon

Hello! I'm working on this roguelike and I'm trying to make it so that the different "maps" can be loaded from text files. It was going pretty good until I tried to get it to return the filled array. Take a look: [CODE]void getMap(string str[10][10]){ ifstream myfile("world1.txt"); int a = …

Member Avatar for Lerner
0
94
Member Avatar for Excizted

Hi. I have a little question, that which answer may mean death to my class plans. I have a superclass (or parent class if you will) that I have to delete when I'm done with it, but does that affect the subclass (or child class if you will)? Simple question, …

Member Avatar for Excizted
0
155
Member Avatar for green_leav

hello members...........i need a help from someone to give me an idea of how can i write a code for cryptex i have an assignment and i couldn't figure out how to start writing a code i just need an idea of how the program will work in order to …

Member Avatar for green_leav
-1
280
Member Avatar for Alex_

hello, i'm trying desperately to recover my c++ knowledge. I haven't done c++ for a year and now i'm facing some problems. Please help. I. How to type cast this: [code=c++] class A { virtual c Read(); } class B: public A { public c Read(){ D d ; return …

Member Avatar for Narue
0
106
Member Avatar for rafaqat hassan

hi my problem is that whan i want to add 2+3 i enter it in postfix 23+ it give me 5 which is correct but whan i want to add 20+30 i enter 2030+ it add me 3&0 because i use char so, this progm is limited to 1 digit.so …

Member Avatar for Lerner
0
74
Member Avatar for littledani

:(i need some help... if anyone of u can give me the programs or any sure hints... den i'll be very greatful to u....

Member Avatar for rafaqat hassan
-9
108
Member Avatar for spitfire

I am getting errors when trying to compile my program, can anyone help? Errors are error C2143: syntax error : missing ')' before 'constant' error C2143: syntax error : missing ';' before 'constant' fatal error C1004: unexpected end of file found Here is my code: [code] // declaration of a …

Member Avatar for wish_C
0
581
Member Avatar for inmar

Hi, I'm trying to use the system() command to invoke "eseutil.exe" and store the output in a text file using VC++. The way i used this command is mentioned below. code snippet: ========= [CODE]string command= "\"C:\\Program Files\\Microsoft\\Exchange Server\\Bin\\eseutil.exe\" /mh \"F:\\fsg\\edb\\mailbox database.edb\" | find \"Log Required\" >output.txt"; system(command.c_str());[/CODE] Compilation is success. …

Member Avatar for donaldw
0
325
Member Avatar for BobFX

Hi, I need to convert a BSTR buffer (that contains wchar data) to a straight char*. How can I do that? I only found that info so far: [url]http://msdn.microsoft.com/en-us/library/ms235631(VS.80).aspx[/url] but it covers only CComBSTR types. I'm not sure how CComBSTR and BSTR relate. Thanks.

Member Avatar for BobFX
0
307
Member Avatar for manosha

HI, I have a prog. assignment, I did most of it, but I couldn't write some functions properly, so try 2 help.? these are the functions I wrote b4.[CODE] #include "Array.h" #include <iostream> using namespace std; Array::Array() //constructor to set size=6 { size=6; } void Array::read() // read array elements …

Member Avatar for DanielGreen
-2
120
Member Avatar for Argo54325

Hello, could someone please tell me how to add buttons, list boxes, tabs, etc. to the main window that shows up with the menu when you first create a win32 windows application? I've been searching for this on Google for about two weeks now and keep coming up dry, any …

Member Avatar for marco93
0
152
Member Avatar for thewonderdude

Hello, I have to read from a .txt file which has info as such, 10:5:23 2:343:54 1:4:7 and so on. 3 Columns, lots of rows. How can i read each column for example 10 to x, 5 to y, 23 to z.

Member Avatar for jonsca
0
136
Member Avatar for Ruffio1981

I'm working on a bonus project for my C++ class. The original problem was to add two large numbers given by the professor, or more specifically, write a program that would add these two numbers. After a while I got it working, relitively easy bit of code with some pointers …

Member Avatar for DanielGreen
0
106
Member Avatar for ivanhny

It's probably really obvious, then again I don't know much about trees in c++. When I try to insert an integer into the tree it doesn't travel down the tree and insert the integer. I'll post the function and then the whole enchillada after. Also how can I create a …

Member Avatar for DanielGreen
0
93
Member Avatar for coolcool

Hi everyone, Am just a beginner in c++ and have wishes to become good in it..it doesn't mean i should become a expert but just a good programmer. also i have enrolled for a competition in the college which am studying which requires an application to be developed using cpp..can …

Member Avatar for DanielGreen
0
110
Member Avatar for laelzio.mosca

I have this tic tac toe code, it`s almost working, can anybody take a look, I think the only thing wrong is in the else statement in main, but I`m not sure, I think I need to place the checkToWin and checkToBlock functions properly in main [CODE]// Laelzio Mosca // …

Member Avatar for jonsca
0
105
Member Avatar for valtikz

anyone knows how to play sounds(wav, or mp3) in (linux)fedora 10 using gtkmm with c++? I only have: [CODE]system ("mpg123 test.wav");[/CODE] but every time the sound will play the program will stuck until the sound has been ended. The sound and program must play at the same time. Thanks in …

0
61
Member Avatar for dalymiddleboro

Hey there I am getting an unusual error message I don't quite understand. I was wondering if I could have some help. The error is " error C3861: 'Tests_weight': identifier not found" I hope you guys can follow the code and any helpful input would be greatly appreciated! Thanks in …

Member Avatar for jonsca
0
69
Member Avatar for mubdea
Member Avatar for jonsca
-2
237
Member Avatar for Alibeg

Hi guys. I have a question - searched for it for at least an hour (i think more, but nevermind). I have this piece of code: [code=C++] cout << word.getLastWord() << "<---" << '\n'; [/code] It is supposed to call getLastWord method of class called Extract. Method returns a pointer …

Member Avatar for Alibeg
0
227
Member Avatar for Alibeg

I guess i'm missing something basic, but i'm new to C++ and do not know how do these streams behave. Can someone please explain why no text is printed to the screen in the following example: [code=C++] #include <iostream> using namespace std; int main (void) { char *ptr = NULL; …

Member Avatar for Alibeg
0
156
Member Avatar for suho

I want to create an mpeg video with [B]ffmpeg[/B] with my program that generates lots of 2D arrays, each of which represents an image. As ffmpeg only takes YUV images. Is it possible to draw a YUV image in c++ or should i generate a RGB image first and then …

0
58
Member Avatar for knish

Hi, how is it possible to make vertices in maya (3d s/w ) react to wind ( dynamic effects ). Brgds, kNish

Member Avatar for Rajesh R Subram
0
97
Member Avatar for t0wel

Hello DaniWeb members! I am using wininet for communicating with HTTP protocol.Everything goes right expect one thing: Cookies. Problem is that all cookies are not saved.Some of them are but no all.For example ASP.NET session id cookie doesnt get saved when i visit page with wininet but i need its …

0
34
Member Avatar for eptheta

can anyone here write me a program which takes data from my parallel port (at address 0x378) every 1 second and saves it to a .txt document somewhere on my computer. I wanted this in c++ or c or any other programming language that i can instantly use or compile. …

Member Avatar for Rajesh R Subram
-2
213
Member Avatar for vino chithra

how can we use very big numbers in a c++ coding ... eg a number which is some 40 digit long... i just found out tat there is some data type known as biginteger ... but its not working in turbo c even after installin reqiured files... can anyone help …

Member Avatar for Rajesh R Subram
0
86
Member Avatar for samsons17

hi... i want to ask about my receipt program again.. this time ,i really like to know the ways how to clear the informations after the user has entered those informations that are neede by the program.. For example,take a look at this sample output : -------------------------------------------------------------------------------------- CASH RECEIPT PROGRAM …

Member Avatar for DarkC0de
0
139

The End.