49,761 Topics

Member Avatar for
Member Avatar for neoxyn

#include <mysql.h> and [code]//try to make connection to database MYSQL *connection, mysql; MYSQL_RES *result; MYSQL_ROW row; int query_state; mysql_init(&mysql); connection = mysql_real_connect(&mysql,"http://1.1.1.1","user","password","database name",0,0,0); if (connection != NULL) { cout << "database connected \n"; }[/code] this code gives me 1>main.obj : error LNK2028: unresolved token (0A000294) "extern "C" struct st_mysql * …

0
26
Member Avatar for CppFTW

Hi, I was wondering if the compiler Visual C++ is smart enough to optimize code like this: [CODE=C++]string temp = "abcd"; string temp2 = "hahaha"; string temp3 = temp + temp2;[/CODE] "temp + temp2" can be replaced by "abcdhahaha" [CODE=C++]vector<char> alphabet; for (char i = 'a'; i <= 'z'; i++) …

Member Avatar for CppFTW
0
160
Member Avatar for denkfix

Hi, I am trying to convert a single wchar_t to uppercase. In theory it should work as shown below, in practice it does not. I have no idea what I am doing wrong. Any ideas? Output is: T T ? ? [CODE] #include <locale> #include <string> int main ( ) …

0
84
Member Avatar for John Linux

What is a pre-processor macro and how is it processed by the C++ system? Demonstrate a potential problem with this approach by referring to the macro [CODE]#define SQR(t) t*t[/CODE] what is wrong here... besides the fact that if you put a type that cant use the * operator you'll get …

Member Avatar for Banfa
0
84
Member Avatar for dimios

Hi everyone, can you help me please with then following?? a)The C++ Standard Template Library (STL) contains a number of container data types, explain with suitable examples the advantages these give to the programmer over a procedural language such as C. b)Demonstrate using suitable code the usage of the STL …

Member Avatar for bandtank
0
216
Member Avatar for sophie.c

Hi everyone, I'm running a c++ program using VS 2010. But during a debugging, the output DoS window disappears when a problem happens. How to stop the output window? I know the problem could be solved by using run-cmd-*.exe. But is there a direct method? I mean, by configuring VS …

Member Avatar for sophie.c
0
200
Member Avatar for xander85

Hello all, I am trying to finish an assignment in my programming class and I can't seem to get this compilation to work... For some strange reason the program will not sum the elements in the array... It is only returning the first input that I enter... Any hints??? I …

Member Avatar for LoganJames
0
1K
Member Avatar for John Linux

Past paper question from 2007: Source University of Cape Town - CSC2001F - 2007 Which of the two statements shown below will provide an lexicographical (alphabetic) string comparsion? why? [code=C++] char *mesg1 = "Hello", *mesg2 = "world"; string s1 = "Hello", s2 = "world"; if (s1 != s2) {...} // …

Member Avatar for thelamb
0
137
Member Avatar for little_grim

Hallo all. Iv spent a lot of time browsing through the old threads and I cannot find a solution to my problem. Please help... I have to files H:\me.txt and H:\you.exe and I want to write a code in Turbo C++ to open these in a separate window, meaning I …

Member Avatar for little_grim
0
1K
Member Avatar for etisermars

Hello, I have a simple question. Look at the following code: [CODE]class ClsA { int * var1; ClsA(); ~ClsA(); } ClsA::ClsA(){ var1 = new int [10]; } ClsA::~ClsA{ delete [] var1; cout<<"Apel destructor"; } void funct(){ ClsA ** p = new ClsA * [10]; ..... delete [] p; }[/CODE] When …

Member Avatar for mbulow
0
134
Member Avatar for blackmagic01021

I am sorry to bother people with silly questions, But I have no choice. I have a statement unsigned short a=4000, current_word; current_word=a << 3; Then I have another statement unsigned long a=4000, current_word; current_word=a << 19; According to my knowledge they will contain the same value. Am I right?

Member Avatar for mbulow
0
137
Member Avatar for umandajayo

hi all... I am a student and but working as a php developer...my desire is be a good skillful Software Engineer. I am currently following php and java too. but my mind say try to learn C++ also.. ok good 01. How I start my C++ career. 02. What is …

Member Avatar for mohsho
0
101
Member Avatar for i_luv_c++

hey guys i am trying to do one level of undo ..however its not working correctly..it does display the text but x and y axis gets messed up..any help and suggestion be great thank you [CODE]void undo(pixeltype pixels[], int length, int option) { struct temp_pixels { int x; int y; …

Member Avatar for nbaztec
0
101
Member Avatar for Kesarion

I'm trying to get the key being pressed in order to start an algorithm and afterwards move the mouse on the screen and perform some clicks. How can I achieve this when the console is in the taskbar ? I tried _getch() but it doesn't work while the console is …

Member Avatar for nbaztec
0
180
Member Avatar for anuragcoder

Hey Guys, Recently ive been developing a text editor when i came to stop. [ICODE]system("cls"); cout <<"\t\t-------------------------------------" <<endl; cout <<"\t\t| NEW FILE |" <<endl; cout <<"\t\t-------------------------------------" <<endl; cout <<"\t\t|Enter New File Name| "; getline(cin,createfile); cout <<"\t\t----------" <<endl; getline(cin,text);[/ICODE] here getline accepts code only until one press enter key How to …

Member Avatar for anuragcoder
0
2K
Member Avatar for cool_zephyr

hello..i'm learning winsock programming in C/C++ and i need to use https connection for connecting to a server..could anyone tell me what does that mean and how do we implement it in a client program?? thanks

0
27
Member Avatar for Tuyet Anh Pham

Please help me solve this problem, I've spent 2 days to search for what error is but I can't!!! The operator + return error object though this object was still right before it is returned. Maybe it's because of the copy constructor but I find no doubt in its syntax... …

Member Avatar for Tuyet Anh Pham
0
303
Member Avatar for pineapple23

Hi, I've been learning basic C++ for the past few days, and at the moment, I'm trying to make a basic 2-number, plus/minus/multiply/divide calculator. Here's what I have (it's complete). Basically I was wondering if anyone could recommend a quicker or shorter way of typing all of this out. Thanks …

Member Avatar for amrith92
0
367
Member Avatar for new2programming

Hi, I have a game that at the moment is a little like mario- a jump and run. I want to add a timer to my main funtion so that after 60 seconds or so the game ends and goes to a highscore table where you can enter your name …

Member Avatar for mrnutty
0
108
Member Avatar for Leontyne

Ok, I'm probly going to sound like a bit of an idiot, but I'm new to the programming world. Whenever I attempt to run this program, I get a long list of error messages. //DATATYPE.CPP //Examples of variable declaration and //initialization. #include <iostream> main () { //declare a constant for …

Member Avatar for olejarskiw
0
154
Member Avatar for gcardonav

Hi guys: I am trying to run my makefile on my system. I am getting the following error [CODE]% make cc -c -O -I/Users/gcardonav/jpeg-6a -I/Users/gcardonav/cfitsio FITS2jpeg.c In file included from FITS2jpeg.c:26: jpegsubs.h:28:20: error: malloc.h: No such file or directory make: *** [FITS2jpeg.o] Error 1 %[/CODE] I do a search for …

Member Avatar for abhimanipal
0
527
Member Avatar for new2programming

i have been following this tutorial on [URL="http://jnrdev.72dpiarmy.com/"]http://jnrdev.72dpiarmy.com/ [/URL]number 3. I am using SDL with visual C++ i want to add a timer to this code then after the timer has run out i want the game to go to a highscore table where you can enter your name if …

0
52
Member Avatar for ferenczi

Hello everybody, I would link to represent a graph with incidence lists. This picture is what I've thought about: [URL="http://img697.imageshack.us/img697/2640/incidence.jpg"]http://img697.imageshack.us/img697/2640/incidence.jpg[/URL] This is what I created: [CODE] #include <cstdlib> #include <iostream> using namespace std; class Edge; class Pointer; class Node { public: Node* nNext; Pointer* incList; char First; Node(char a) : …

Member Avatar for ferenczi
0
112
Member Avatar for jimJohnson

Can someone check my work to make sure I did the following correct... The array-based implementations of stacks in this section impose and upper limit on the max size that a stack may have. Write a member function full() for the stack class that returns true or false according to …

Member Avatar for griswolf
0
147
Member Avatar for jimJohnson

Can someone please double check to make sure I have these right. Here are the instructions... Assume that q is a queue implemented as described using circular array with queueElement = char and capacity 5, and then ch is of type char. Show the values of myFront and myBack and …

Member Avatar for jimJohnson
0
78
Member Avatar for jimJohnson

I am doing some stack exercises and just want to make sure I have the correct answers. Assume StackType is sent to int and STACK_CAPACITY is set to 5. Give the values of myTop and the contents of the array referred to by myArray in the stack s after the …

0
50
Member Avatar for broli100

Hi, I am making application where I need to repaint windows form where I display some variables. I used InvalidateRect(NULL,0,0); - now the form is refreshing but started to blink because I refresh whole area,and I dont need to refresh all the buttons and static text ,only area where I …

Member Avatar for broli100
0
105
Member Avatar for riotburn

I am trying to create my first library and I guess the dynamic library is the best suited, though I don't know the difference between the two. I am following this tutorial: [url]http://msdn.microsoft.com/en-us/library/ms235636.aspx[/url] My questions are: 1. So pretty much I make my header file and a respective cpp file …

0
53
Member Avatar for Kesarion

I'm trying to translate a Pascal mouse movement algorithm to C++ but I'm not too good at it. The mouse moves to a position but when it moves again it only goes a small increment and crashes after a few more moves or if I move the mouse a few …

Member Avatar for iamthwee
0
402
Member Avatar for VilePlecenta

I've been trying to disable the desktop ( in its entity ) so that no window can get focus and I can draw on top of it. Since creating a fullscreen window and drawing on that will lag all the other windows. Ive tried WM_ENABLE and EnableWindow with the handles …

0
63

The End.