rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, argv should be a const char* not a char*. There are two main ways to process command line arguments. One is to loop from 1 to argc and process each argument (old style). The other is to call the function getopt() for each supported argument. These days, the preferred method is to use getopt(), though I must confess to usually using the old style, simply because of 30 years of bad habits! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Most of these plugins are shared libraries (dll's in Windows lingo) that the application can dynamically load. They need to go into a directory that the application knows about and can find them. IE, just building them may not be enough. You probably need to copy/move the dll (or .so if running Unix/Linux) to a known directory for shared libraries, or configure the application to look for it elsewhere.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Plese post the entire compiler error output. However, line 18 is wrong. Instead of cin>>a.foot<<a.inches<<endl; try cin>>a.foot>>a.inches;

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Or they could use an environment variable or user preferences to determine the browser of choice, and do that, as in system(getenv(DEFBROWSER)).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What SQL library are you trying to use? Is it an implementation of the ODBC API's, or something specific for a particular database. For example, MySQL has its own library for C and C++ connectivity (my current project uses their C++ library). Oracle has similar. They both have ODBC and JDBC libraries (JDBC == Java DataBase Connectivity, ODBC Open DataBase Connectivity) as well. ODBC is generally a C library, and JDBC is a Java library (.jar files).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

An interpreter is not the same as an emulator or compiler. An binary code interpreter will interpret the machine instructions dynamically at run time. An emulator will be an environment that poses as the target machine, and execute the instructions just like a physical machine. A compiler will take source code and turn it into machine code, which can then be executed on a physical machine, an emulator, or interpreted by the interpreter.

In Linux system, Qemu is an emulator support framework - allowing emulation of many classes of machines. The GCC compiler suite takes source and turns it into the target machine code. It is rare to see a machine-level interpreter these days. Source code interpretation is not so uncommon however. IE, there are C and C++ interpreters that can take source code, and run it without compilation. An emulator requires code already compiled for the target hardware.

Confused yet? :-) This is very advanced stuff...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It is also usual to put in guards to avoid including the file multiple times in order to avoid certain classes of compiler errors. Here is an example, call it myheader.h:

// myheader.h
#ifndef MYHEADER_H
#define MYHEADER_H

// Put header stuff here
class MyClass
{
private:
    int m_intmember;
public:
    MyClass() : m_intmember(0) {}
    ~MyClass() {}
    int getIntMember() const { return m_intmember; }
    void setIntMember(int nv) { m_intmember = nv; }
};

#endif // MYHEADER_H
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Another possible approach may be to install the Windows Services For Unix, which as I recall includes an ssh server component. That may be better than trying to tunnel via Cygwin.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The Mac supports the Unix/Linux CUPS printer drivers and configuration (.ppd files). There should be such stuff for the Dell. Go to their support page for this printer and search from there.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. Did some more debugging. To is initialized to 0, but you are dividing by To (divide by zero == no-no) at the start of the loop so it doesn't go into the loop. So, your solution is to use do {} while (condition); instead of while (condition) {}; - that will work for both cases. FWIW, trapezios not returns 0.954499 and simpson returns 0.954500 as it did before.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

In function trapezio() you do not initialize the variable To, hence the result of fabs((Tk-To)/To) is NAN (Not A Number). The reason Mingw may have worked could be because it auto-initialized the automatic variables.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

RTFM? If you are doing this in Matlab, they have tonnes of tutorials and documentation that will describe how to do this.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are certainly simulation tools written in C++, but these are very complex, and specialized, bits of software - not something you just go out and write in a day or three. As Mike_2k said, what kind of system do you want to simulate? If you can get into some specifics, we may be better able to suggest some tools to try.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Try this:

bool compare_arrays(int a[], int b[], int maxcnt)
{
    bool answer = true;
    for (int i = 0; i < maxcnt && answer == true; i++)
    {
        answer = (a[i] == b[i]);
    }
    return answer;  // Note that you should always have a default return value.
}

Remember to pass the array size (5 in your example) as the 3rd argument to compare_arrays().

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What is the user.group ownership and flag settings on the stunnel.pem file and the directory it is in? It is likely that either the flags/ownership on the .pem file or the directory containing it are wrong.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Current is one thing. Voltage is another. Did your repair guy also verify the voltage while charging the battery?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Yet it won't run if not plugged in?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What Mike_2K said, plus to re-emphasize that writing good serialization/deserialization (orthogonal) methods into abstract classes is very difficult. I have done such for software used to run most semiconductor fabs today (MES frameworks), so I know some of the problems you face. The frameworks I developed would work with either TCL or XML wire format messages. The sender would serialize itself to the appropriate form, and the receiver would automatically detect the format and de-serialize it accordingly into a faithful representation of the object sent. The object could be highly complex, consisting of many sub-objects of various types. At times, the serialized string can be 10+MB in length, and contain recursive (circular) references where one object contains a reference to another previously encountered in the hierarchy. That was one of the more difficult problems to solve. Fortunately, both TCL and XML have constructs to deal with that! :-)

FWIW I wrote the original code for that about 20 years ago - prototyping it in Smalltalk, and then implementing it in C++.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

C is a great language for low-level (close to the machine) code, but for more complex systems I prefer C++. You might appreciate this, that I consider Java to be C++ with training wheels! :-) That said, I have developed enterprise class systems with both C and C++ over a 30+ year career as a professional software engineer. I write most of my code (except kernel code) in C++, but I don't eschew C functions, because of their simplicity and practicality, especially for network (sockets) programming - after all, even Stroustrup (the author of C++) considers C++ to be "C with classes". :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Not enough information and your attachment shows nothing helpful... :-( Remember that Qt is a C++ application library / IDE. It probably doesn't like non-ascii characters for symbol names (ascii values < 128). The locale settings probably don't have any effect, though I don't know for sure. My last work with Qt was 4.x.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Anyway, this stuff is why C/C++ is difficult for many programmers, dealing with pointer issues and arithmetic.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Alternatively

int* Board::accessColCount()
{
    return &colCountArray[0];
}

Simply returning &colCountArray is an int** as the array name itself is a pointer, illustrated by Moschops' reply.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. Teach me arabic and I might be able to help... :-) What encoding is used for the hex representation? Is it Unicode, or something else?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You might want to provide some references and information about this algorithm, as many of us, even those of us with a lot of C++ and other systems experience, may not be familiar with it... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

See item #3 in your list of instructions - modify an existing game. That seems to be the crux of the problem. Your professor appears to want that you take one of those single-player games and adapt it to a multi-player model. Sounds like a challenge! :-) He/she is trying to get you to think how to take what is, and adapt it to your needs - requires thought, design effort, and coding work. Good luck!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What browser are you using?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

One last suggestion is that instead of shutting the system down, just hibernate it when you aren't using it. It will start up much faster than a cold boot.

SerbOz commented: thanks rubberman. that's works! +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Most systems these days have several "features" that slow down booting tremendously. One is the UEFI "secure boot" feature enabled by default on all Win8 systems. The other is all the "trialware" installed on the system - trial versions of a gazillion different tools you probably don't need or want. Uninstall all of them - most will just have a 30 day trial period and many will install "server" components that are started on system boot. The other issue is that Win8 sucks (just my opinion)... See if you can get Win7 on the system instead of Win8. That is a much more reasonable operating system (again, just my opinion, but that of many others as well).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I'm not an attorney, but I think what you want to do is illegal in most states in the US and most countries abroad as a violation of privacy and/or felony computer hacking. You would do so at your own risk - if you get caught you are likely to be in deep doodoo (and probably divorced pdq). So, don't ask us to help you break the law and hack systems like this... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Time for a trip to the repair depot - it is likely that the system power controller is fubar.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

With current distributions that use the RPM format there are better front-ends for installing packages so that dependencies will be properly accounted for and installed if necessary. For Red Hat distributions (RHEL and Fedora, Scientific Linux, CentOS, Oracle Linux) you would use the yum command (YUM == Yellowdog Update Manager). For OpenSuse or Suse and related distributions you would use yast (I don't know what that stands for).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

And get a good reference book, such as Bjarne Stroustrup's "The C++ Programming Language". The current version is the 4th edition - all 1200 pages... :-) Stroustrup is the author of C++, so if there is a better reference, I haven't found it!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your first example has no doubles, just an int and a float. If you were to cast the 3.14 value to a double it would probably work, or use 3.14D. It may also work if you use 3.0 for the first argument.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What all these good people said. In any case, your compiler should have emitted a warning that your were initializing a non-const string to a const char* "". DO NOT disable compiler warnings, unless you really know what you are doing!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your example does not match what you said should be the pattern.

it must start in the center and then move to the right and then up and then to the left, making a spiral.

Yet your example starts at the top and moves right and down, as in:

      4   5   6
  14  15  16  7
  13  18  17  8
  12  11  10  9
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

"no as in why would the OP purchase debian?"

Simple. Some times people either are uncomfortable downloading and burning CD/DVD discs, so they purchase ready-to-run media, or they don't have an adequate burner. IE, you can go online or to Best Buy and purchase many Linux distributions... :-) What you pay for is the manufacturing and distribution for the most part. It may cost you $25-$30 instead of $100+ for Windows, etc. Ubuntu used to have a free media program where they would send you free the entire system on CD/DVD, though you had to wait for awhile. I actually got one of those once just to see. Naturally, mostly I download and burn (or create a VM) the iso images. A 4GB live DVD takes me about 2 hours to download, and 10 minutes (and a $0.50 disc) to burn.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, but we don't do your homework for you. In any case, in your example where A::=XA/Y and B::=XB/Z, do you mean A = (XA)/Y and B = (XB)/Z? Or something else?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Code is helpful, but logic (often called pseudo-code) can be more so in order to see what your thought processes are in solving the problems.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What operating system are you using? In effect, the short answer is yes. The long answer is "it depends". The video hardware you have (GPU graphics card) is also an important element.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

FWIW, these are basic CS math problems. See your professor if you need help understanding the problems.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, you want us to do your homework for you? :-( Not going to happen! Make an honest effort and if you are still having problems, post the code here and we might decide to help you... DO NOT CHEAT!

nitin1 commented: true!! +2
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Aws pritaeas said, use the GitHub search function. You may also want to visit sourceforge.net and use their very useful search tool as well.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The & operator returns the address of the item it is applied to. It should be used with care as it can return an address that you don't expect under some circumstances. In any case, please provide a case of where you think you need to use it and we can better help you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

All the links I provided are free downloads.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I understood that, but your PS was so ambivalent that it is effectively useless. That is why I posted a sample for you. The purpose of pseudo-code is to express clearly what is to be done. That should be easily morphed into real code, depending upon the language you are going to program it in. After 30+ years of serious software development, I still use pseudo-code to help me clarify my intentions and designs. It helps tremendously to eliminate logic errors for the most part.

FWIW, I meant PC (pseudo-code) instead of PS in previous posts... Danged keyboard keeps mis-typing... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Generally, what JorgeM said is correct. However, for simple LAN configurations it can be pretty much PnP (Plug and Play). IE:

Internet <-> Router (dhcp server) <-> switch <-> computers

This assumes that the computers are all configured to use dhcp to get network addresses (normal default). Issues arrise when you need a LAN-based system to be a local or internet-facing server. Then, it starts to get complicated... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Get a router to handle the connection. It can use what is called NAT (Network Address Translation) to translate LAN (local network) addresses and allow all the computers connected to the LAN to access the internet without problems. You will need to configure your computers to use DHCP or (if not mobile devices) LAN static addresses that are in the LAN subnet address range (eyes glazing yet?). The router will provide IP addresses for these systems on the LAN, and when they connect to the internet, the router will know how to route messages between them and the internet, and vice versa. This also provides much better security since outside agents (malware) will not so easily compromise your systems.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Take a class? Read a book? Ask a friend (anyone under 40)?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What web browser are you using? FWIW, both Firefox and Chrome have addons for blocking popups and ads (adblocker and adblocker+). Install those, and 98% of the ads will be blocked and this problem should go away.