|
by: zexpe |
last post by:
I have an extremely cpu/data intensive piece of code that makes heavy
use of the following function:
void convertToDouble(const std::string& in, double& out)
{
out = atof(in.c_str());
}
I would really like to get away from using any old C-style functions.
So, I modified the above function to make it follow the C++ convention:
|
by: Dekker |
last post by:
Hi
I would like to transform the result of a csv-string (eg.:
"name,age\nstring,int\nMac,23\nMax,24\nMike,78") into a map of vectors
map<string, vector<???> >.
The key of the map will be the fieldname (name or age) and the values
are stored as vectors in the indicated type (string, int). Like this i
can call: result (= a string "Mac") or result (=
an int of val 23)
|
by: Ben Wheare |
last post by:
Hiya,
I'm fairly new to C++, and trying to figure out how to do the following:
I have a class, strings, which has a private char array. To add to
this array, I call the member function add_array(int), with an int,
which populates the array (in this case with the binary equivalent of
that integer).
I want to make another class, messages, which encapsulates the strings
|
by: LinuxDuud |
last post by:
Hi,
First, Sorry if the title was bad, I really didn't know how to describe
this.
So,
What I need to do is something like this:
char somevariable; // The tricky part. I don't know how to define
it.
somevariable = "Hello";
somevariable = "Goodbye";
And to print them using:
|
by: pallav |
last post by:
I am writing a logic simulator for boolean circuits. I have a textfile which will contain vectors like this
abc
001
100
111
...
I want to be able to bit pack these vectors to get a = 110, b = 100, c = 101 so that i can simulate them using a 32 bit int or a 64 bit set (hence 32/64 vectors at a time). I'm trying to figure out the most efficient way to quickly read in and bitpack these vectors.
|
|
by: CoreyWhite |
last post by:
/* WORKING WITH STRINGS IN C++ IS THE BEST WAY TO LEARN THE LANGUAGE
AND TRANSITION FROM C. C++ HAS MANY NEW FEATURES THAT WORK TOGETHER
AND WHEN YOU SEE THEM DOING THE IMPOSSIBLE AND MAKING COMPACT COHERENT
CODE THAT WORKS WITH STRINGS, IT ALL BEGINS TO MAKE SINCE*/
/* The basics of C++ are Classes, that build Types. Which are used to
create quick and dirty routines in the smallest possible space. The
Classes & Routines uses the...
|
by: andrewmorrey |
last post by:
Hello,
I've got a VC++ project containing multiple classes and a main
function. In one of the class functions, it reads from a text file and
places the data into a vector;
//
std::vector<std::vector<std::string applications (50,
std::vector<std::string>(12));
applications = "Test1";
applications = "Test2";
|
by: mersinli |
last post by:
Hello;
I will use standard library vectors and implement simple map coloring algorithm. The goal of a map coloring problem is to color a map so that regions sharing a common border have different colors
In C++ I can represent the neighboring information using a 2D vector of booleans. For example, consider the following 2D neighbor vector:
Countries 1 2 3 4
1 - T F T
2 ...
|
by: Caudata |
last post by:
I am by no means an experienced c++ programmer, but I am trying to use a vector of vectors because it is convenient to store some strings while parsing a text file. I am having trouble with the nested for loop recovery of the stored data and properly dereferencing the data. Here is a bit of test code:
#include <iostream>
#include <string>
#include <vector>
using namespace std;
struct s {
string strA;
|
by: Laura Wilkinson |
last post by:
I've got many differences between vectors/strings and arrays but I need more details. I guess I don't really understand it enough to do this but this is what I've concluded so far;
An array is a collection of data storage locations, holding the same type of data and can be individually referenced by adding an index to a unique identifier.
They can be declared by writing the type, the array name and then the number of elements.
A vector...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
|
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: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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.
|