|
by: Christopher Reeve |
last post by:
Hi, I wonder if anyone could help me. I am moving accross from C to
C++ and am writing a program that reads and writes data into a file. I
am aware of the old C ways of doing it but am trying to use the C++
functions which don't seem to be working propperly.
I need to open the file for reading and writing because I want to
search for a possition in a file called settings.dat and then write a
number after a certain chatacter. However when...
|
by: Dave O'Hearn |
last post by:
I want to open a file for both reading and writing, but when I do
"ios::in|ios::out" with an fstream, it creates the file if it doesn't
already exist. I don't like that last part. C's fopen has the "r+"
mode, where the file will open for reading "+ also writing", but it
will not create a new file if one isn't already there; it fails with
an error. POSIX also has this behavior with it's 'open' call, you just
leave the 'create' bit out, and...
|
by: Griff |
last post by:
#include <iostream>
using namespace std;
#include <vector>
#include <string>
#include <fstream>
#include <algorithm>
template<class C>void PrintAll(C&v)
{
|
by: jccorreu |
last post by:
I've got to read info from multiple files that will be given to me. I
know the format and what the data is. The thing is each time we run
the program we may be using a differnt number of files, with different
file names each time. So i'm writing into the code to ask the user how
many files, and what their names are. From each we'll read in 2 lines,
then do some math using all of those lines. Then do it again on another
set of lines. ...
|
by: Robbie Hatley |
last post by:
Say I have an ifstream object, like so:
#include <iostream>
#include <fstream>
int main(int, char* Sam)
{
std::ifstream Bob;
Bob.open(Sam);
std::string buffer;
while (42)
|
|
by: Xian |
last post by:
Is there a right and proper (tm) way to end a line? Thinking about
portability and the mess that the 'wrong' line endings can cause.
E.g.
std::cout << "Hello World!\n";
or
std::cout << "Hello World!" << std::cout;
--
/Xian
|
by: Robin |
last post by:
// Pls note that test.txt exists.
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
fstream fs("test.txt", ios_base::in | ios_base::app);
|
by: mahesh |
last post by:
Hi all,
I have following code that is supposed to increase the power by
specified value.
int main()
{
system("cls");
int i, exponent;
double base;
double new_base=0.0;
|
by: mauricesmith42 |
last post by:
Sorry i know this is rather large to be posting, but in order to understand the question you have to see all the code
//#include <windows.h> //needed for opening folders
#include <stdlib.h> //needed for converting integers to strings
#include <iostream> //needed for in/out commands ie. cin/cout
#include <fstream> //needed to open readable/writeable files ie. ifstream/ofstream
#include <string> //needed to create strings from...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
|