Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 C++


  mysql – connection example

Mysql is a database, and to gain access to the data within C++ you will need to be able to “talk” to the database via queries (just like on the mysql command line interface e.g. select * from tablename), the connection process is very similar to the command line interface you will need to supply connection details as in hostname (localhost normally), username, password, database to use and also there are other details that you can pass e.g port number more information can be gained from the MYSQL API pagesTo start with I created a struct that will hold the username, host etc detail...

4,757 0       MYSQL C++ CONNECTION DATABASE EXAMPLE


  A Tiny MySQL++ Tutorial; C++ and MySQL; MySQL++ Example

I wrote a post about how to install MySQL++ and I thought I will write a quick tutorial on how to use it too.This is a very basic MySQL++ program and it’s very self explanatory:#include <mysql++.h>#include <stdlib.h> using namespace std;using namespace mysqlpp; int main() { try { Connection conn(false); conn.connect("DB NAME", "DB HOST probably localhost", "DB USER", "DB PASS"); Query query = conn.query(); } catch (BadQuery er) { // handle any connection or // query errors that may come up cerr << "Error: " << er...

17,954 4       EXAMPLE C++ MYSQL++ INSERT API


  C++ Without Fear: Functions

A function is a group of related statements that accomplish a specific task. Understanding functions is a crucial step to programming in C++, as Brian Overland explains in this chapter from his book.The most fundamental building block in the programming toolkit is the function—often known as procedure or subroutinein other languages. A function is a group of related statements that accomplish a specific task. Once you define a function, you can execute it whenever you need to do so.Understanding functions is a crucial step to programming in C++: Without functions, it woul...

1,959 0       C++ FUNCTION FEATURE ELABORATION FEAR


  Moving from Java to C++: An Interview with Rogers Cadenhead

In this interview, co-author of Sams Teach Yourself C++ in 24 Hours, 5th Edition Rogers Cadenhead discusses moving from Java to C++, what brought him to C++, and the best tactics for learning C++.Danny Kalev: For how long were you a Java programmer? Can you tell us a bit about the nature of the projects in which you took part at that time?Rogers Cadenhead: I've been a Java programmer since the language was launched by Sun Microsystems in 1995. I was doing website development, and Java applets were the first available platform for creating interactive programs that ran ...

2,381 0       JAVA C++ TRANSFER TRANSFORM NEW CHALLENG


  Top Ten Tips for Correct C++ Coding

Brian Overland, long-time Microsoft veteran and author of C++ Without Fear: A Beginner's Guide That Makes You Feel Smart, 2nd Edition, shares 10 of his most hard-earned, time-saving insights from decades of writing and debugging C++ code.My first introduction to the C family of languages was decades ago (yes, I know this dates me horribly). Later I learned C++. I wish someone back then had steered me around the most obvious potholes; it might have saved me hundreds of frustrating hours.I can give you at least a few of those much-needed (excuse the term) pointers. This isn’t a tutor...

1,739 0       TIPS C++ TOP TEN MAGIC NUMBER INTEGER DI


  Native Client Brings Sandboxed Native Code to Chrome Web Store Apps

Wouldn’t it be great if you could create web apps using your existing C and C++ code? Native Client lets you do just that, and it is now enabled for Chrome Web Store apps in Google Chrome’s beta channel. Native Client apps live on the web platform, so you don’t need to create separate versions of your app for each operating system. Rather than relying on OS-specific APIs, Native Client apps use Pepper, a set of interfaces that provide C and C++ bindings to the capabilities of HTML5. This means that once you’ve ported your code to Native Client, it will work across d...

4,127 1       C++ WEB APPLICATION NATIVE CLIENT USEFUL


  Hail the return of native code and the resurgence of C++

Programming language trends come and go. First, Java is the hot new language, then it's Python, then Ruby steals the limelight, then it's back to JavaScript. But the latest language darling is probably the last one anyone expected. Believe it or not, 2011 could be the year of C++.Last week, the latest version of the ISO C++ Standard was approved by unanimous vote. It's the first major revision of the language in 13 years. Now officially known as C++11, the new standard introduces features designed to make it easier to develop software for modern parallel processing architectures, including lam...

2,625 0       C++ FUTURE RETURN BACK POPULAR LOCAL DEV


  10 Tips To Make Your C Program Effective

The beauty of any code lies not only in finding the solution to a given problem but is in its simplicity, effectiveness, compactness and efficiency( memory ). Designing the code is harder than actually implementing it. Hence every programmer should keep a couple of basic things in mind while programming in C. Here we introduce you to such 10 ways of standardizing your C code.1. Avoid unwarranted function callsConsider the following two functions:view source print?1void str_print( char *str ) 2  3{ 4  5    int i; 6  7    for ...

2,779 0       TIPS C EFFICIENT SPEED INCREMENT RECURSI