1,174 Posted Topics

Member Avatar for jdpjtp910

[QUOTE=jdpjtp910;1127095] Since the record was not edited by the program why did the price and quanitity change? [/QUOTE] In the [ICODE]displayRecord()[/ICODE] there is an extra [ICODE]inventory.read(...)[/ICODE] at the start of the function. So the position is hence off by one. And then a little error where the address of operator …

Member Avatar for mitrmkar
0
125
Member Avatar for CppBuilder2006
Member Avatar for gregarion

error: cannot convert ‘std::string’ to ‘const char*’ for argument ‘2’ to ‘int mysql_query(MYSQL*, const char*)' That says that you cannot pass a [ICODE]std::string[/ICODE] to the mysql_query(). Since it expects a [ICODE]const char *[/ICODE], you need to use the [ICODE].c_str()[/ICODE] method, so simply change to; [CODE]mysql_query(conn, queryText.c_str());[/CODE]

Member Avatar for Fbody
0
2K
Member Avatar for ppotter3

There is a very basic problem that you have in main(). Now if you go through it carefully, you'll notice that there are [ICODE]float Mean[/ICODE] and [ICODE]float MeanValue[/ICODE] trying to serve the same purpose.

Member Avatar for ppotter3
0
1K
Member Avatar for ms_farenheit1

A few quick notices, 1) These two are declared and used, but not implemented bool operator==(const matrix &); bool operator!=(const matrix &); The code should not actually compile because of that, isn't your compiler saying anything? 2) There is no copy constructor i.e. [ICODE]matrix(const matrix &)[/ICODE], you absolutely need one, …

Member Avatar for jonsca
0
122
Member Avatar for tetron

[QUOTE=tetron;1122182]I appear to have hit a memory limit in visual studio.[/QUOTE] Since you are trying to allocate rather huge amounts of memory (2GB), I'd guess that the limitations are more probably imposed by your operating system (which one is it?) than the std::string implementation. See MSDN documentation on [URL="http://msdn.microsoft.com/en-us/library/aa366778(VS.85).aspx"]Memory and …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for smith73

[QUOTE=smith73;1123753]Please explain what you mean by Tag before you post, this is my first time so I have no clue in what Im doing today.... LOL[/QUOTE] Well, adnan.siddique tried to say that use [I]code tags[/I] when you post code. That will preserve the code formatting making it readable. As you …

Member Avatar for smith73
-3
113
Member Avatar for Nicholas_Roge

[QUOTE=Nicholas_Roge;1123133]I've changed LoadLibrary((LPCTSTR)("test.dll")) to LoadLibrary((LPCTSTR)("C:/Users/Nicholas Roge/Desktop/test/test.dll")), however there isn't any luck. Unless I misunderstood what you were telling me to try, however.[/QUOTE] Have you UNICODE defined? If so, then the following cast[COLOR="Red"][/COLOR] [code] LoadLibrary([COLOR="Red"](LPCTSTR)[/COLOR]("test.dll")) [/code] causes this behaviour. The end result is that a non-UNICODE string gets passed to LoadLibrary[B]W[/B]() …

Member Avatar for Ancient Dragon
0
157
Member Avatar for tomtetlaw

The declaration of [ICODE]class CBaseAnimating[/ICODE] is missing a semicolon.

Member Avatar for mitrmkar
0
500
Member Avatar for n.utiu

[QUOTE=n.utiu;1098424]Dev is quite a good compiler and editor but IMO the debugger...sucks.[/QUOTE] In that case you might want to try out VC++ 2008 Express.

Member Avatar for abdelhakeem
0
91
Member Avatar for Lukezzz

This should do .. [code] public ref class DoubleBufferPanel : public Panel { public: DoubleBufferPanel(void) { this->SetStyle(ControlStyles::DoubleBuffer | ControlStyles::UserPaint | ControlStyles::AllPaintingInWmPaint, true); this->SetStyle(ControlStyles::DoubleBuffer, true); this->UpdateStyles(); } }; [/code]

Member Avatar for Lukezzz
0
386
Member Avatar for miteigi-san

[QUOTE=miteigi-san;1121801]the program seems to ignore the getline part? why doesnt it work?[/QUOTE] I'd suspect that [ICODE]openWP.seekg(20*wordnum, ios::beg)[/ICODE] causes that to happen. If you seek to a position that's out of range, then [ICODE]getline()[/ICODE] will fail. You can see it for yourself by adding some output, for example [code] // snip …

Member Avatar for tetron
0
545
Member Avatar for Dizzzy

[QUOTE=Dizzzy;1121151][CODE]warning: format %d expects type int, but argument 3 has type __off_t[/CODE][/QUOTE] Change [ICODE]%d[/ICODE] to [ICODE]%ld[/ICODE]. That'll most probably fix it, [ICODE]%ld[/ICODE] tells that the argument will be [ICODE]long int[/ICODE]. If the warning persists, post back. [EDIT] Badly beaten by AD it seems, though I'm still in favour of trying …

Member Avatar for mitrmkar
0
314
Member Avatar for lparras
Member Avatar for asa88

You have to move the [ICODE]int Banger::objectCount=0;[/ICODE] to the the banger.cpp file.

Member Avatar for asa88
0
118
Member Avatar for lsandling

[QUOTE=lsandling;1118344]I guess I am really having trouble with what's inside the function [B]How do I get it out[/B]..[/QUOTE] You get it out by passing it in in the first place. So for example [CODE] struct theThing { int ThingYesNo; double ThingHeight; // zero-initialize the member variables theThing() : ThingYesNo(0), ThingHeight(0) …

Member Avatar for lsandling
0
118
Member Avatar for Roger_Hades

[QUOTE=Roger_Hades;1118733] i have trouble trying to display the name of the contacts. p->first.get() [/QUOTE] What is the error message your compiler is giving?

Member Avatar for Roger_Hades
0
161
Member Avatar for phoenix69

[QUOTE=phoenix69;613791]I tried many times but all in vain. Error...error.. and not even compiled.[/QUOTE] One practical approach, to get you started, would be to post the code that is not compiling (along with the error message(s)).

Member Avatar for peter_budo
0
1K
Member Avatar for Chetan_

Since it is a null pointer assignment, you might be able to start finding out the cause(s) of the crash using [ICODE]assert()[/ICODE]. So, for all your pointers wherever used, do: [ICODE]assert( the_pointer != NULL );[/ICODE] Likewise, add sanity checks, so that you will not allocate zero-length strings, i.e. [ICODE]assert( size_to_alloc …

Member Avatar for mitrmkar
0
200
Member Avatar for hermann87
Member Avatar for mitrmkar
1
506
Member Avatar for cin.fail

Just pass the vector by reference, so you will have [code] int solveMaze(int x,int y,vector< vector<char> > & maze,int size); [/code]

Member Avatar for jonsca
0
210
Member Avatar for abhimanipal

[QUOTE=abhimanipal;1115002]Why does scanf("%d %d"+2) become scanf("%d") ?[/QUOTE] Would the following be of any help? [code]#include <stdio.h> int main(void) { char const * p = "invisible text" + 10; printf("%s", p); return 0; }[/code]

Member Avatar for xavier666
0
142
Member Avatar for mmasny

You can also simply delete the line 32, [ICODE]otwarte_okna[/ICODE] gets constructed via the [ICODE]ListaOkien[/ICODE] default constructor automatically.

Member Avatar for mitrmkar
0
102
Member Avatar for Roger_Hades

[QUOTE=Roger_Hades;1115472][code] bool sortByName(tropical &t1, tropical &t2); sort (fruitlist.begin(), fruitlist.end(), sortByName); //problem!! gives me rubbish errors when compiled. could it be compiler problem?? [/code] [/QUOTE] GCC 4.4.0 says; [ICODE]stl_algo.h:124: error: invalid initialization of reference of type 'tropical&' from expression of type 'const tropical'[/ICODE] meaning that you need to change to: [code]bool …

Member Avatar for Fbody
0
12K
Member Avatar for LemonLemon

If it is CString as in MFC, then CString has methods like, Find(), FindOneOf(), Left(), Right() and Mid().

Member Avatar for mitrmkar
0
138
Member Avatar for phpangel

[QUOTE=phpangel;1109818]tell me where exactly i should declare the identifier "i"[/QUOTE] If you look at the compiler error message, it includes the file and also the line number where the error occurs, for example, given an error message like: foobar.cpp(10) : error C2065: 'i' : undeclared identifier you should open foobar.cpp …

Member Avatar for tux4life
0
954
Member Avatar for sexyzebra19

[QUOTE=sexyzebra19;1113432] however the cin doesn't seem to be working - I'm getting the initialised value of 0 for n no matter what I enter.[/QUOTE] That's because you are passing n by value. You need to pass it by reference instead, i.e. [code] double gauss(fun f, double a, double b, int …

Member Avatar for sexyzebra19
0
96
Member Avatar for sexyzebra19

[QUOTE=sexyzebra19;1112353] what I have done wrong?[/QUOTE] To point out basic errors, see the comments below [code]#include<iostream> #include<vector> #include<cmath> #include<iomanip> using namespace std; class tabledata { private: long double abscisass[28]; long double weights[28]; public: void set_values(); } // a global variable here, will you be using it? If not, delete it. …

Member Avatar for sexyzebra19
0
150
Member Avatar for twelvetosix

A basic tutorial that might come in handy is [URL="http://www.winprog.org/tutorial/"]theForger's Win32 API Programming Tutorial[/URL].

Member Avatar for twelvetosix
0
1K
Member Avatar for sailee

[QUOTE=hammerhead;592457]Okay here is the pseudo code for hcf, credit to Euclid.[/QUOTE] Umm, I think I got the hcf part of it (thanks hammerhead), but how to figure out 'lcm of 2 nos' just beats me :-/ ...

Member Avatar for hk<3ob1993
0
195
Member Avatar for bman214

That's good to hear. But after all, maybe it still would be better to put the game aside for some time, and learn how to use functions/structures instead. What do you think? This is just to say that don't overdo yourself with a single function consisting of several hundreds of …

Member Avatar for bman214
0
143
Member Avatar for c0d3x

[QUOTE=Grn Xtrm;1111738]I missed the brackets for the check array in the if statement. [/QUOTE] There is more than just the brackets here, i.e. [code] // not [COLOR="Red"]"[/COLOR]\n[COLOR="Red"]"[/COLOR], but instead ... if ( check[0] != '\n' ) [/code]

Member Avatar for mitrmkar
0
2K
Member Avatar for Learning78

Since you are not seeing [ICODE]MessageBox("INCORRECT"); [/ICODE] it's apparent that [ICODE]if(s == correct)[/ICODE] always evaluates to true (assuming that [ICODE]CI2T::IsCorrect()[/ICODE] gets called). Have you tried debugging? Put breakpoints at proper places, so that you'll be able to trace how [ICODE]s[/ICODE] is getting its value (and [ICODE]correct[/ICODE] too, unless it's a …

Member Avatar for mitrmkar
0
159
Member Avatar for ashishchoure

You haven't told whether your [I]program[/I] is 32 or 64-bit. Anyway, did you try [URL="http://msdn.microsoft.com/en-us/library/ms724340%28VS.85%29.aspx"]GetNativeSystemInfo()[/URL] ?

Member Avatar for ashishchoure
0
234
Member Avatar for ppotter3

Just a suggestion, how about first primarily focusing on coding well-working basic routines (i.e. sorting, searching in this case), without them being 'slightly modified' for any specific purpose. Hence you would have something solid to further build upon. In other words, you would have a sorted array of strings, and …

Member Avatar for mitrmkar
0
712
Member Avatar for freeseif

[QUOTE=freeseif;1108401] NOTE: [icode] ب = 0x0628 = "\u0628" [/icode][/QUOTE] 0x0628 is not UTF-8, but rather UTF-16. Dave Sinkula's [ICODE]0xD8 0xA8[/ICODE] is the UTF-8 representation of \u0628.

Member Avatar for Ancient Dragon
2
2K
Member Avatar for Ancient Dragon
Member Avatar for Ancient Dragon
2
318
Member Avatar for Japus

[QUOTE=Japus;1107299] I'm trying to use taglib in my Qt-program but it won't work. With this code, it doesn't compile <snip> What's wrong? [/QUOTE] Difficult to say, maybe even your compiler is faulty. In this kind of cases, rather post the actual compiler error message(s) along with the offending piece of …

Member Avatar for Anarionist
0
140
Member Avatar for iou

[QUOTE=iou;1106196] So does anyone know how to make use of getline() for this?[/QUOTE] You were on the right track (i.e. [URL="http://www.cplusplus.com/reference/string/getline/"]getline()[/URL]) in the beginning, so you might get the input doing e.g. the following: [CODE]#include <iostream> #include <string> using std::string; using std::getline; using std::cin; using std::cout; int main() { string …

Member Avatar for mitrmkar
0
336
Member Avatar for Agni

[QUOTE=Agni;1105345]Thanks Dave, I tried -pedantic option and it is still only giving a warning to me. Shouldn't it be a nice and proper error? [/QUOTE] Maybe try [ICODE]-pedantic-errors[/ICODE]

Member Avatar for Agni
0
139
Member Avatar for gedas

[QUOTE=gedas;1105055]thank you very much your reply and for your solution i was trying to do it completely differently here is the code [CODE] // read the file from comand line and displys it #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> main(int …

Member Avatar for mitrmkar
0
129
Member Avatar for emi teliyadu

You need to tell the compiler what to do by specifying files/options on the command line. Clicking on the compiler executable will not do much as you've already noticed. Perhaps read a basic [URL="http://www.learncpp.com/"]tutorial[/URL], I'd suggest you to go through sections; 0.4 Introduction to development 0.5 Installing an Integrated Development …

Member Avatar for jonsca
0
104
Member Avatar for Ultratermi

[QUOTE=Ultratermi;1103695] I cant find the same with System^String in WinForms... [/QUOTE] See e.g. [URL="http://msdn.microsoft.com/en-us/library/k8b1470s.aspx"]String::IndexOf Method (String)[/URL]

Member Avatar for Ultratermi
0
103
Member Avatar for shaunmccann1

I'm suspecting that you are unnecessarily trying to convert data back and forth (being somewhat unfamiliar with c++). So, if you'd describe in detail what you need to do, someone here might suggest a simple solution.

Member Avatar for shaunmccann1
0
162
Member Avatar for froggy1976

[QUOTE=froggy1976;1103642]I would like to put the string day[7]; as private since the days of the week will never change [/QUOTE] Given the above code, you might have the [ICODE]string day[7][/ICODE] as a private member variable. So you must be doing something illegal in the code that you did not post. …

Member Avatar for mitrmkar
0
129
Member Avatar for baken33

[QUOTE=niek_e;1103000]Here's a start: [code] #include <iostream> int main () { std::cout << "welcome to my program"; return 0; }[/code][/QUOTE] Sorry niek_e, but that's not actually useful since the OP is to write a [I]C program[/I] (according to the instructions given) ;)

Member Avatar for Nick Evan
-3
148
Member Avatar for shizu

That sounds like something rather complicated. One thing I can say though is that if you are using [ICODE]WM_SETFOCUS/SetFocus()[/ICODE] within that dialog box, then just don't. Those are not meant to be used with dialog boxes. Rather use [ICODE]CDialog::GotoDlgCtrl()[/ICODE] or [ICODE]WM_NEXTDLGCTL[/ICODE] to set the focus.

Member Avatar for mitrmkar
0
139
Member Avatar for sisse56

[QUOTE=sisse56;1102028] how can I solve the problem [/QUOTE] Start off by reading the many answers you've already gotten so many times. If you don't understand a specific piece of advice, then ask for more details about that specific case. (I assume using English is not the problem for you here …

Member Avatar for WaltP
-2
127
Member Avatar for k1_zav

[QUOTE=k1_zav;1101951]But the codes works properly when G=280 and l=3...[/QUOTE] Since you are unwilling to post any code, I guess that you have this [CODE]const int G=290; const int L=3; float ReplicatedMat[G+1][L];[/CODE] inside a recursive function eventually causing the stack overflow. [EDIT] Perhaps run the program in the debugger and at …

Member Avatar for k1_zav
1
83
Member Avatar for shizu

Have you tried the following ? [CODE]// WM_INITDIALOG handler of your property sheet class // (derived from CPropertySheet) BOOL CMyPropertySheet::OnInitDialog() { BOOL bResult = CPropertySheet::OnInitDialog(); // Hide the Cancel button GetDlgItem(IDCANCEL)->ShowWindow(FALSE); // Disable the OK button GetDlgItem(IDOK)->EnableWindow(FALSE); return bResult; }[/CODE]

Member Avatar for shizu
0
703

The End.