49,761 Topics
| |
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] … | |
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 … | |
how to create asterik star like this [B][COLOR="Red"]>[/COLOR][/B] with 10 Asterik star (*) | |
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 … | |
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) | |
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, … | |
[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); … | |
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 … | |
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 … | |
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 = … | |
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, … | |
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 … | |
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 … | |
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 … | |
:(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.... | |
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 … | |
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. … | |
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. | |
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 … | |
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 … | |
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. | |
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 … | |
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 … | |
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 … | |
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 // … | |
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 … | |
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 … | |
hallo everyone. I need a code for "Gaussian elimination with scaled partial" please help me | |
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 … |
The End.