Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x

C++

57K

Solutions

24K

Contributors

C++ is an intermediate-level general-purpose programming language, not to be confused with C or C#. It was developed as a set of extensions to the C programming language to improve type-safety and add support for automatic resource management, object-orientation, generic programming, and exception handling, among other features.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hello,
I am trying to run this simple program in visual studio 2017 community edition and I am getting compilation error
Error      C2059      syntax error: '...'      

where am I going wrong here? Please help

#include "stdafx.h"
#include<iostream>

using namespace std;

template <typename ...Args>
void Printer(Args&&... args)
{
	(cout << ... << args) << endl;
}

int main()
{	
	Printer(1, 2, 3, "abc");
    return 0;
}

Open in new window

0
Become an Android App Developer
LVL 11
Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

i would like to develop a page which can interact with AD so that user's can update their contact details on the fly and it's in sync with AD so that signatures are up to date. I also want to flash the page every 30/60 days to every user so that they are forced to check and update their contact

i have attached a layout , which i would like to create a page so that i can ask every user every now and then to update their contact details.
0
Dear all,

I have an open code of MFC made in 2002. Could someone please tell me approximately which is the version of this script?

I imagine it is Microsoft C or Microsoft C++, but which version if was compiled in 2002?

Thanks

mfc.jpg
0
C++03 using VS 2010. (Assume no boost available.)

I would like to find the missing points in the below diagram using C++03 std lib. The x's represent a set of given points, and the o's are the missing points.

x----o--x----x---o
|    |  |    |   |
o----o--x----o---x
|    |  |    |   |
o----x--x----o---x
|    |  |    |   |
x----o--x----o---o
|    |  |    |   |
x----x--o----o---o
|    |  |    |   |
o----o--x----o---o

Open in new window

I am given a set of points Pi = (Xi, Yi). The coordinates are of type double. If I were to draw a grid (consisting of horizontal and vertical lines) going though every point, I may have some missing points as shown above.

The result should be a std container having the (X, Y) points that are missing.

I suspect that http://www.cplusplus.com/reference/algorithm/set_difference/ or some variation might be useful. So getting the entire list of potential points somehow is probably also useful. Although speed is always a plus, it is not essential.

Any code suggestions?

BTW - there are NOT going to be any tricky points - like a point very far away from the main set of points.
BTW - I've been using axis indices to represent the actual axis coordinate values (but don't worry about that if it complicates the code).

I can probably do this using brute force using a 2D array; so the purpose of this question is to use std lib algorithm functions to simplify the code and hopefully improve performance.
0
VS2010 has a feature to "Restore Window Layout" to relay out all mainframe, menu, toolbars, and dockPanes, without restarting. How do I have my VS2010 wizard-generated MFC MDI app does this programmatically? Thanks.
0
I want to invoke login() method written in java.this login method requires one input parameter of type Consumer. Please find signature below.

 public void login(Consumer<String> consumerObj)
{
     ------------
}
In JNI implementation(C++ side) I need consumer like below.

env->CallVoidMethod(loginMethodClassID, loginMethodID,consumerObj);
I am not able to create consumerObj.

For your reference,sharing my java code snippet. In my Java Test class for invoking this same login method I do following.

Consumer<String> consumerObj= url ->
{
   webBrowser = new WebBrowser(url);
   webBrowser.start();
};
Application.login(consumerObj);
I know how to invoke login method but I need help on how i should create that consumerObj object.

Your help will be highly appreciated
0
I have recently learned C++ and C#. That is, I have taken courses to understand the basics of them and now want to start using them for professional work. I have said I want to take on projects that push me to learn a lot more about these vast programming languages. I have a hardware device name Griffin PowerMate. It is a USB knob/wheel that can be helpful controlling a computer. For some reason, it does not have great support on Window 7, 10. It does have a driver for Window XP and Vista. I cannot get this device to do what I want in Windows 10. However, on a Mac computer, the driver is up to date and does everything I want. So, to me this proves what I want on the Windows side is possible. Is it likely to think that without an SDK from the company I could use C++ or even C# to create a driver for this device?
0
Reading and Writing CSV Files in MFC code

Files has to open in OpenOffice for the first Data. without closing the OpenOffice  ,In background  ,program s running and
datas has to saved in the CSV files. close the file and reopened the file .new data s has to updated.But only one data thats is also first data only in CSV file.(only in OpenOffice ,datas are not saved  while processing file should in open then  close the file  and reopened the same file,no datas updated )

code was working in CSV FIle Viewer and Notepad++ while opened while processing ,closed and reopened the same file, data are updated )
Plz help
0
I`m a manual Quality Assurance. I really need an automation in my hard work. How should I good start? Have you any ideas? I use Selenium and C++ at my work. But is a basic C++ enough? I was thinking to go to college to take some C++ credits there. Maybe there something like https://domywriting.com/ which could help me in my work. I`m really lost in it because I don`t have the Computer science degree.
0
Hello everybody!
I`m looking for a good and EASY library that works with sending and getting a .wav file voice message, can you please share your experience with me which library to choose as there are plenty of them out there
Thank you in advance!
0
Technology Partners: We Want Your Opinion!
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

So i have a program which filters a file containing "emails" in a single line, i link you to the exercise (it is a pdf) https://training.olinfo.it/#/task/ioit_spam/statement so my problem is that it doesn't accomplish all of the 4 tasks but from my tests (i've created a file with 1000 emails) it should correctly and pass all of its cases. i don't know if it's a problem of the corrector on the site (you need to register to test the program) but i link here the scoring (it should score 100 in theory) it might be a problem of the corrector? https://imgur.com/a/QmeY5 and the source file is this https://pastebin.com/iVPXUjxb
Thanks to everyone answering i hope i've made the question clear, the program works in my machine, it can even scan 10000 emails if i'd want to, infact i've tried filtering a 8mb file containing 1000 emails with 1000 words each.
this is the link for the 1000 emails input file https://drive.google.com/file/d/1f9OWkzZ_i9T8s6BcNIq5hXqBogCR2Dcj/view?usp=sharing
0
Hi!!!
I was going to send a struct from a client to a server using boost::asio::async_write_some, in this case boost::serialization and boost::property_tree come to help,
//boost::serialization
struct blank
{
    int m_id;
    std::string m_message;

    template<typename archive>
    void serialize(archive& ar, const short version)
    {
        ar & m_id;
        ar & m_message;
    }
};

blank info;

info.m_id = 1;
info.m_name = "Rasul";

std::stringstream ss;
boost::archive::binary_oarchive out_archive(ss);

out_archive << info;

Open in new window


So, now how can I send/receive out_archive using boost::asio asynchronously .. or
//boost::property_tree
boost::property_tree::ptree root;
root.put("id", 2);
root.put("name", "Rasul");

Open in new window

How can I send/receive root using boost::asio asynchronously??? (If you have some other ideas please share them)
0
I will be given a set of X/Y points and their corresponding Z values. Z = f(X, Y), but I do not know the function f. The points will be clustered together and I don't expect pathological conditions. The local maximums and minimums will have extra sample points to help make the interpolation better. The goal is to come up with a smooth surface that represents the function f as close as possible.

The analyst providing me with the set of points of known XYZ points will also give me an XY rectangular grid; and at all the intersection points of horizontal and vertical lines, I need to provide a z-value.

One thought I had was to consider a point and look at 4 quadrants, and take the closest point in each quadrant, and using those 4 points or more to try to interpolate. Prefer to be able to use a curved surface to get the results rather than linear planes. One rule is that the final results will match the given XYZ points . The given points are known as anchor points or knots.

I am just looking for something functional. I am not interested in speed.

 I am not allowed to use binaries, so I will have to build from source code in Linux or Windows.

Thanks in advance.
Paul
0
i want to create one dialog control with three buttons dynamically and  same dialog to created dynamically again 12 dialog s with the same content and size  but 12 dialogs control  should appear tile in format.
0
Background: i work in a red hat and Windows 10 environment. We have models written in Matlab and Simulink that the developers will convert to C++ in order to get higher speed simulations. We do not like the C++ code that can be generated from these two products. We have a simulation proprietary framework which provides us with many math APIs for C++.

We currently use C++03 with Visual Studio 2010 and g++. Lead developer has no experience with C++11 but he would like to convince a large community of divisions to upgrade to C++11 . I asked him what skill levels of developers would he be bringing in . He said his group cannot afford the best, and he believes that C++ 11 is more complicated than C++ 03. Recently I've been doing this survey of multithreading capabilities in C++11, boost, Pthreads, WIN APIs , and while I can see that C++11 features are rich , they are also complicated to use correctly . For example if you want to squeeze performance out of a program that uses many cores , then you have to learn about the C++11 memory model, and be aware of all the tricky race conditions that can occur when the high-level code is done out of order as result of compiler optimization .

 Could someone give me a list of C++11 features that an average C++ developer could use and explain how it is beneficial with a strong argument that we convince a large community of divisions to agree to upgrade to C++11 .

 Two items that come to mind are multithreading and dimensional …
0
how to create a user interface thread in mfc and UI thread will display  the  four times the dialog box should open.
0
Hello!

I am a new member and I saw that you already have some old posts regarding dxf libraries.
I found the topics very useful for my search but they are a bit old.
For this reason, I am creating a new post for new suggestions and ideas!

I am searching for C++ (or C) libraries which can read dxf files, preferably all versions.
I have an issue with the license type as I want to use it for a commercial software.
So, I need a library with license MIT, 3-clause BSD or commercial.

I would be grateful if you have any ideas!
Thank you very much for reading this post.
0
Here is the tutorial I followed to get this far:
https://www.experts-exchange.com/articles/1132/Browser-Bot-Automate-Browsing-Sequences-With-C-PART-ONE.html#c2064546

What I'm doing is using an embedded web browser to interact with an HTML page.

In my code I'd like to set a checkbox to checked.


I'm trying to use an web browser object in MFC to interact with a website and check a checkbox.

I have a function that gets the DOM object and then where I'm struggling is using the interface to select the checkbox.  I've been able to interact with textfields and buttons no issue. Just the checkbox that's killing me.
My elementFromID function basically does this

   
 pDisp->QueryInterface(nTypeIID, (void**)&pElement);

Open in new window


Where nTypeIID is IID_IHTMLElement or whatever 2nd param is passed in.
pElement is what is returnedback.


   
So getting the element isn't the issue, it's interacting with it.
No where in the MSDN documentation can I find where it says how to set a checkbox value.

   
 void* pElem = ElementFromID(L"checkbox_id", IID_IHTMLElement);
	if (pElem != nullptr)
	{
		IHTMLElement* pCheckbox = (IHTMLElement*)pElem;
		VARIANT checked;
		checked.boolVal = true;
		checked.vt = VT_BOOL;
		pCheckbox->setAttribute(L"checked", checked, FALSE);

        // Alternate approaches that failed
        /*pElem = ElementFromID(L"order_terms", IID_IHTMLInputElement);
		IHTMLInputElement* pCheckbox = (IHTMLInputElement*)pElem;
		

Open in new window

0
Hi! I've been programming for several years in Delphi, then C++Builder but recently I started programming concurrrently(threads)
I've read on documentation VCL should be used by "synchronice" method. My question: all of the objects from VCL should be
treated within a Synchronice call or only when severals threads use the same object or only when they affect the GUI(labels, buttons
and others properties)?. Suppose I have n threads but each one of them use their own objects(labels, tlistbox, etc) inside a TPage for each one, so there's a TPageControl for all of them should I use Synchronize?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE
LVL 5
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

I'm using currently the project
https://support.microsoft.com/de-de/help/246227/sample-secumgr-exe-overrides-security-manager-for-webbrowser-host
to check if a web portal, for example http://fontello.com/, works fine with EOT, WOFF and TTF to displaying different icons.

It looks like fonts with the Content-Type application/vnd.ms-fontobject or application/font-woff could not be used with IWebBrowser2.
In the webtraffic i could see, that the app could download the fonts, but after the download i received the error E_ABORT in the IHttpNegotiate::OnResponse handler.

The web pages works in IE, but when we disable font download in the security settings we get the same 'problem' with the IE.

I tried to enable the font download in function IInternetSecurityManager::ProcessUrlAction
(URLACTION_HTML_FONT_DOWNLOAD) without a positive result.

What i'm doing wrong?
0
I have a short meta-programming approach for POD type safety from a previous question:
https://www.experts-exchange.com/questions/29056989/C-03-Templatize-Type-Safety-Enforcement-Part-2.html

I see the benefits of meta-programming as simplifying the development process for units - I believe that all new developers would have to do is to include a units header file, and follow a simple recipe for defining new data types.

I wrote in that question:
Other dimensional analysis areas that I am leaning towards:
 1. Make the class name part of the template
 2. Make the set of enumeration values part of the template so that they are not universally available
 3. Be able to operate on two different families of units. One obvious example would be:
        "distance (meters) = rate (meters/sec) * time (sec)".
     But we will have many other cross-unit operations as well.

I thought that I may as well see if I can get some tips on these ideas. If these 3 goals are realistic, but too much for one question, I am happy to work on what is reasonable for one question.

At the moment, I have to transcribe the previous question to my workstation, and then sell the ideas here and from the previous question to my lead software developer. The PM and Systems Engineer definitely like the idea of POD type safety. I just hope the lead likes the template approach.
0
How to insert image or picture in turbo c
Plz me
0
Can someone help me write this program in c++?

 Suppose a teacher weights the four exams he gives 10%, 25%, 30%, and 35%.
Write a program that reads ten sets of four grades, prints the weighted average of each set, and prints the unweighted average of each test. The number of students should be in a global constant.

I know I need to use a for loop, but I'm not sure how to write it. Can someone show me how to code this along with guiding me through the code?
0
NestingLayout.png
Here is my layout i need this in visual studio c# or c++ please help me to soft this problem. here i requested to give me idea to process layout like this,

thanks in advance
0
I would like to use Png images while working in C++ Builder RAD Studio XE6. I am using graphics32 lib and I managed to install runtime and designtime packages. I can put the TImage32 component on my form, then I load the png image in TImage32, but instead of transparency, I get white color on the background. I just cant see what do I have to do, to get transparent png image on my form.

I would be very thankful for your help.
0

C++

57K

Solutions

24K

Contributors

C++ is an intermediate-level general-purpose programming language, not to be confused with C or C#. It was developed as a set of extensions to the C programming language to improve type-safety and add support for automatic resource management, object-orientation, generic programming, and exception handling, among other features.