49,761 Topics

Member Avatar for
Member Avatar for 28daniela28

Hi, I want to read/write data from a file and I don't know how (I'm using Visual studio c++). More exactly, if I have the following code: [CODE]#include<iostream> #include<fstream> using namespace std; int main() { ofstream newfile; newfile.open("exemplu.txt"); myfile<<"I want to write this in a file\n"; newfile.close(); return 0; }[/CODE] …

Member Avatar for 28daniela28
0
110
Member Avatar for spiderphp

Given a system of n independent linear equations ([I]n[/I] equations in [I]n[/I] unknowns). Write a program to solve these equations using Gaussian Elimination method with scaled partial pivoting. In other words solve the system Ax=b(where the n*n matrix A, and the vector b are known) for the values of unknown …

Member Avatar for jonsca
-2
102
Member Avatar for Adrhian77

how to create asterik star like this [B][COLOR="Red"]>[/COLOR][/B] with 10 Asterik star (*)

Member Avatar for Nick Evan
1
99
Member Avatar for invincible35

Hello friends, I have two laptops. One of them has a window application software which is working perfectly in that system. But now i want to copy the same software in other laptop but couldn't do so. I have the original CD of that software but somehow it doesn't seem …

Member Avatar for Nick Evan
0
83
Member Avatar for emmawatson4u

Here's a question for you. create two arrays to store roll and marks of students respectively whose name will be known at run time (use pointers)

Member Avatar for Stefano Mtangoo
-3
45
Member Avatar for sivaprakas
Member Avatar for kevintse

I am building applications targeting Windows Mobile, I need to read and write files. I am not sure whether to use the C++ standard library (iostreams) or the Windows API (ReadFile(), WriteFile()...). I think the Windows API is faster than the C++ standard library, but they are not object oriented, …

Member Avatar for Frederick2
0
225
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
256
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
102
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
156
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
282
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
107
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
381
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
314
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
121
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
62
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
70
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

The End.