1,174 Posted Topics

Member Avatar for Jennifer84

[QUOTE=Jennifer84;616278] However I wonder why it goes up to 130 MB, that is a lot more than perheps it should be about 70 MB instead.[/QUOTE] Every std::string object that you push onto a vector has its own overhead. You can check in code what sizeof(std::string) gives to be the size …

Member Avatar for Jennifer84
0
128
Member Avatar for Bitto11

Try relocating the outtext(item) call ... [CODE] void boxout(int xstart,int xend,int ystart,int yend,char item[]) { setcolor(BLACK); moveto(xstart,ystart); setcolor(LIGHTGRAY); setfillstyle(SOLID_FILL,LIGHTGRAY); rectangle(xstart,ystart,xend,yend); floodfill(xstart+1,ystart+1,LIGHTGRAY); for(int i=xstart;i<=xend;i++) { putpixel(i,ystart,WHITE); putpixel(i,yend,DARKGRAY); } for(i=ystart;i<=yend;i++) { putpixel(xstart,i,WHITE); putpixel(xend,i,DARKGRAY); } [COLOR="Green"] outtext(item);[/COLOR] }[/CODE]

Member Avatar for Bitto11
0
182
Member Avatar for pa3k80

[QUOTE=pa3k80;616198]How make in MFC C++: i need a function, the function has read a txt file and put a message box with text which is in txt file.[/QUOTE] Below is one way of doing it [code] void some_function() { CStdioFile File; CString strLine; CString strMsg; if(File.Open("file.txt", CFile::modeRead)) { while(File.ReadString(strLine)) { …

Member Avatar for mitrmkar
0
102
Member Avatar for CoolGamer48

The buffer next_room_script[] lives in the scope of the containing if() block. Your problem will go away if you change the m_nextRoomScript to be a std::string because the string will copy and hold the data you have read from the file. The pointer version just points to the temporary buffer …

Member Avatar for mitrmkar
0
87
Member Avatar for Sky Diploma

1) To make the call Date::set_default(), needs the set_default() to be a static member function. 2) It is not enough to declare a static member variable inside the class declaration, you also need to define and optionally initialize it. [code] class Date { // a non-const default date static Date …

Member Avatar for Sky Diploma
0
148
Member Avatar for banban2008

[QUOTE=banban2008;615543]tell what should i do and how ????[/QUOTE] I think you should study from the very beginnings of C++. See [url]http://www.cprogramming.com/tutorial.html#c++tutorial[/url] for a beginner's tutorial, especially pay attention to topics you need "if , case , while , switch, functions". Take your time to go through it, and maybe post …

Member Avatar for e_pech
0
155
Member Avatar for joshmo

[QUOTE=joshmo;615530]but i dont know where to start..i have tried comparing strings but i get stuck on [B]how the loop should ignore [/B]the string "hello 33"[/QUOTE] [B]Ignoring[/B] the string is the same as not writing it to the output file at all. Like Salem stated: Now in the while loop you …

Member Avatar for VernonDozier
0
183
Member Avatar for JoE Guana

[QUOTE=JoE Guana;615229]Hey I made this function i think it'll do the job. But i keep getting an expected declaration before "}". What do you guys think? [/QUOTE] Hi, First of all, I repeat what VernonDozier already stated; [B]Use code tags and formatting please:[/B] see here [url]http://www.daniweb.com/forums/misc-explaincode.html[/url] Then about the errors …

Member Avatar for VernonDozier
0
218
Member Avatar for Jennifer84

You might find ZedGraph useful, it's a class library written in C#. The project's web site is here [url]http://zedgraph.org/wiki/index.php?title=Main_Page[/url] And some sample projects can be downloaded here [url]http://sourceforge.net/project/downloading.php?group_id=114675&use_mirror=heanet&filename=zedgraph_sample_projects_5.1.2.zip&83843110&testing=1[/url]

Member Avatar for mitrmkar
0
299
Member Avatar for Kob0724

Move the definition of QStringList FuncCntrlParams::type_pairPotList into the respective .cpp file.

Member Avatar for Kob0724
0
2K
Member Avatar for Cybulski

Add e.g. a Reset() member function in which you reset the member variables to desired values.

Member Avatar for Duoas
0
107
Member Avatar for QuantNeeds

This is simple to fix ... relax [code] Employee employee1(); // <- actually declares a function returning an Employee // instead use ... Employee employee1; [/code] If the Employee's constructor would take argument(s), then you could have it like [code] string FirstName, LastName; Employee employee1(FirstName, LastName); [/code] Regarding code tags, …

Member Avatar for QuantNeeds
0
198
Member Avatar for people123

[QUOTE=people123;614276]The part that I am stuck at: [url]http://img60.imageshack.us/img60/993...webhelpqj4.jpg[/url][/QUOTE] You have to select the correct list from the "Show directories for:" list Then click the yellow folder image to add a new entry to the list and enter the path. [I]<SDKPath>[/I]\Include directory goes into the "Include files" list and [I]<SDKPath>[/I]\Lib into …

Member Avatar for ismetteren
0
132
Member Avatar for savinki

If your intention is to convert a string of digits to a long value, then see the strtol() function [url]http://www.cplusplus.com/reference/clibrary/cstdlib/strtol.html[/url]

Member Avatar for Radical Edward
0
231
Member Avatar for SonxQ7

[QUOTE=SonxQ7;612718]Excel 2003 has both LOG() & LOG10(), why would the LOG() in spreadsheet be log10() in C? [/QUOTE] Unable to answer that one, but just for reference: Compute natural logarithm / log() [url]http://www.cplusplus.com/reference/clibrary/cmath/log.html[/url] Compute base-10 logarithm / log10() [url]http://www.cplusplus.com/reference/clibrary/cmath/log10.html[/url]

Member Avatar for jephthah
0
220
Member Avatar for CoolGamer48

[QUOTE=CoolGamer48;613525]Also, is there a way to check if the end of a file has been reached with ifstream? Because I'm using feof() in my program.[/QUOTE] see [url]http://www.cplusplus.com/reference/iostream/ios/eof.html[/url]

Member Avatar for mitrmkar
0
84
Member Avatar for sieghart0123

The end condition for the loop where you iterate over the list might be wrong or your list is not terminated properly (or something else). If you've been wondering about this for a week now, it is probably better to post code that is relevant to the problem.

Member Avatar for sieghart0123
0
130
Member Avatar for Kadence

I think the link step is missing the wrapper library itself (libmysqlwrapped) in which the Database class' code is. So you need to find out where that library is and link with it too.

Member Avatar for Kadence
0
714
Member Avatar for bgbnbigben

I think you might be missing the point 'The latter being trivially true all the time.' i.e. you have to write the if statement like: [icode]if (f == 1 || f == 3) [/icode] If you write it like: [code] if (f == 1||3) // or if (f == 1 …

Member Avatar for bgbnbigben
1
177
Member Avatar for zawpai

[QUOTE=zawpai;612087]but I really don't know where the error is. The compile's error is the following: LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main [/QUOTE] Change mian() => main(). Also, really please use the code-tags feature when you post code. [url]http://www.daniweb.com/forums/misc-explaincode.html[/url] EDIT( this post just became so redundant because Niek_e cooled …

Member Avatar for zawpai
-1
148
Member Avatar for Triggerhappy41

If you want to stick with the original [icode]ostream& operator<<(ostream& out, [COLOR="Green"]const[/COLOR] Card& c)[/icode] then you need to make the getSuit() method also const .. [code]const char getSuit() [COLOR="Green"]const[/COLOR]; // and ... const char Card::getSuit() [COLOR="Green"]const[/COLOR][/code] One more link for you .. [url]http://en.wikipedia.org/wiki/Const_correctness#Methods[/url]

Member Avatar for Triggerhappy41
0
145
Member Avatar for yelugamraghu

Use plain %f with a double with printf(), see [url]http://msdn.microsoft.com/en-us/library/hf4y5e3w(VS.80).aspx[/url] Mr Sinkula once pointed out (to me) that: "using %lf with printf is undefined behavior in C90, a common nonstandard extension, and standardized in the uncommonly-implemented C99 as ignoring the l."

Member Avatar for jephthah
0
273
Member Avatar for BAEdwards

[Code] // Your thread accesses the form via a variable named 'Form2' // The 'Form2' variable below is local to the function and hence // hides the intended 'Form2' variable i.e. the correct 'Form2' does // not get assigned to anything. [COLOR="Red"]TForm2 *[/COLOR]Form2 = new TForm2(this); Form2->ShowModal(); [/Code]

Member Avatar for thekashyap
0
168
Member Avatar for zawpai

Try printing the arguments the program receives, I think you are simply not calling it correctly (maybe e.g. due to spaces in file paths) [code] if (argc != 3) { cout << "Usage: compfiles <file1> <file2>\n"; for(int ii = 0; ii < argc; ++ ii) { cout << "Arg# " …

Member Avatar for mitrmkar
0
160
Member Avatar for toolbox03

The totalProduct pointer probably is not what you expect it to be inside the [icode]void Customer::getCustomerProduct(...)[/icode]. I.e. you have not allocated any Products and are trying to call getProduct() on a non-existing object. totalProduct is left uninitialized at this point <-> you should initialize it to zero in the Customer's …

Member Avatar for Nick Evan
0
146
Member Avatar for qt.alan

Shouldn't you change from 'int *prt;' to 'decode *prt;' ? Then you could change to [code][B]ifstream &[/B] decode::loadDecode(ifstream &fin) { fin >> alphabet; fin >> code; return fin; } // ... and use it like while (de.loadDecode(fin)) { prt = new decode(de); // you are not checking the result of …

Member Avatar for mitrmkar
0
157
Member Avatar for Jennifer84

That happens because you have [icode][B][COLOR="Red"]System::DateTime[/COLOR][/B] LastSourceTime = CurrentSourceTime;[/icode] <=> LastSourceTime is there a variable local to the if -block. You have to change it to simply: [icode]LastSourceTime = CurrentSourceTime;[/icode]

Member Avatar for Jennifer84
0
109
Member Avatar for lahom

With MFC you could lookup how to use class CStdioFile (see the Read() and GetLength() member functions).

Member Avatar for mitrmkar
0
274
Member Avatar for scarface3288

At least one note, somewhere along the code you have: [icode]output_file<<"Answer:" << endl;[/icode] and later on you are attempting to read in values from the very same file [icode]in_stud>>m[i];[/icode] That just silently fails because of the string you have written there (I'm assuming here that m[] holds floats <-> I …

Member Avatar for scarface3288
0
102
Member Avatar for Beemer

You could write a condition statement also so that the variable is on the right side of the expression, i.e. [icode]if (0 == noModsPassed07)[/Icode] This way your compiler will spot an obvious error, i.e. [icode]if (0 = noModsPassed07)[/Icode] will not compile.

Member Avatar for Salem
0
103
Member Avatar for Jennifer84

If it is sufficient to use the time the file was last written as an indicator of a change, then you can utilize GetLastWriteTime(), like: [icode]System::DateTime LastWriteTime = System::IO::File::GetLastWriteTime("file.txt");[/icode] I.e. at some point store the time and then later on compare the times to see whether there is a change.

Member Avatar for Jennifer84
0
147
Member Avatar for hocuz pocuz

[QUOTE=hocuz pocuz;610622]can you also write in text or only binary?[/QUOTE] If you will write the data as Ancient Dragon showed, then use the binary mode only.

Member Avatar for Ancient Dragon
0
261
Member Avatar for Sky Diploma

[QUOTE=Sky Diploma;609794]Should sky.exe >out.txt be written in a specific place? or anywhere else?[/QUOTE] Specify any location of your choice that you have write access to. Regarding the system() and std::string, you can use: [icode]system(some_string.c_str());[/icode]

Member Avatar for Sky Diploma
0
146
Member Avatar for shakumar_21

Lookup the Tool Help Library functions .. [URL="http://msdn.microsoft.com/en-us/library/ms684887(VS.85).aspx"]process walking[/URL]

Member Avatar for mitrmkar
0
63
Member Avatar for heav_yduty

m_dwVersion IS a member of AFX_MODULE_STATE, but only when you compile with _AFXDLL defined.

Member Avatar for mitrmkar
0
250
Member Avatar for mussa187

You have a mismatch in some of the functions, they are declared as returning a string but you are returning (0). Either return a string from those functions if you need to, or maybe change to e.g. [code]void ip_uri_store::uri_ip(string uri50, string ip50)[/code] if you will not be needing a string …

Member Avatar for mussa187
0
112
Member Avatar for e_pech

Ancient Dragon's link is pretty much on the topic .. you can also find some complete MDI/SDI examples, with and without splitters, by downloading the sample code of the The MFC Answer Book, freely available here: [url]http://www.informit.com/content/images/0201185377/CDContents/Code.zip[/url] There are three demo applications related to switching views: SwitchViewMDI, SwitchViewSDI and SwitchViewSplitter …

Member Avatar for e_pech
0
431
Member Avatar for EngSara

If the format is as follows SER(FIT): 7.6e-003 1.3e-002 1.2e-002 1.5e-002 5.2e-003 you can parse a line by ignoring the 'SER(FIT): ' and then extracting the floating point values. See below ... [code] #include <iostream> #include <fstream> #include <string> using namespace std; int main() { ifstream in("file.txt"); string dummy; double …

Member Avatar for EngSara
0
260
Member Avatar for virtual_friend

:icon_wink: Well, you just have to step forward and post something relevant to the problem(s).

Member Avatar for mitrmkar
0
76
Member Avatar for Cybulski

[QUOTE] "." should be found and displayed, but it isn't.[/QUOTE] You are missing the initial match ... [code] ... long nHandle = _findfirsti64(s_filename.c_str(), &struct_filedata); if(nHandle >= 0) { [B]cout << "First match is: " << struct_filedata.name << '\n';[/B] while(_findnexti64(nHandle, &struct_filedata) == 0) { ... } [/code]

Member Avatar for mitrmkar
0
354
Member Avatar for noraantonia

[QUOTE]when i hit the "New" menu from the File menu it doesn't erase or clear my drawing I don't know why.[/QUOTE] A bit difficult to answer because not knowing how your drawing code is setup, so I [B]guess[/B] that the drawing code is within the view class/file i.e. the document …

Member Avatar for mitrmkar
0
191
Member Avatar for Metalsiege

You exceed the array bounds by using the pre-increment operator in [icode]Temperatures[++Count] = CurrentTemp;[/icode] change it to [icode]Temperatures[Count ++] = CurrentTemp;[/icode]

Member Avatar for Metalsiege
0
203
Member Avatar for SonxQ7
Member Avatar for BigEnglisHoward

Save the current working directory (_getcwd()) before you save a document and then restore it using _chdir() after that. (Assuming that you are unable to make changes to the serialize function to prevent it from changing the directory in the first place).

Member Avatar for BigEnglisHoward
0
94
Member Avatar for mertucci

[QUOTE=mertucci;607745]but i want to take numbers from user how can i ?[/QUOTE] You already correctly take all the input from the user by using cin, e.g. the following works [icode]cin>>x;[/icode] But you cannot call a function like this: [icode]hesap.arith_ex(int x,int y ,int z);[/icode] The above line actually generates all of …

Member Avatar for mertucci
0
123
Member Avatar for mertucci

Just pointing out some very simple errors you have there ... [code] class CollegeStudent:public Person { public: char nameofclass [B][COLOR="Red"];[/COLOR][/B]// need a semicolon here void goster2(); }; CollegeStudent::goster2() // [B][COLOR="Red"];[/COLOR][/B] <- must not have a semicolon there { cout<<"Name of Class"<<name[B][COLOR="Red"]o[/COLOR][/B]fclass<<endl; // A typo there, typos are fatal } ... …

Member Avatar for mertucci
0
179
Member Avatar for Jennifer84

You could write a simple comparison function that you can supply to the std::sort(). [code]bool MyCompare(const string & lhs, const string & rhs) { // std::sort() calls this function each time it needs to determine the // order of two items .. // // Todo: compare here the strings in …

Member Avatar for Duoas
0
150
Member Avatar for Onixtender

<< if I try to push changed data using function, I get just the [COLOR="Red"]same word n times[/COLOR]: That happens because you are pushing pointers to one single buffer you have in your whole program, and that buffer is char recordd[]. In other words, you can write to that buffer …

Member Avatar for Onixtender
0
182
Member Avatar for CoolGamer48

<< Block.obj : error LNK2001: unresolved external symbol "protected: static class Texture * << Block::m_img4" (?m_img4@Block@@1PAVTexture@@A) [code] class Block : public Object { public: Block(); ~Block(); <snip> protected: static Texture* m_img1; static Texture* m_img2; static Texture* m_img3; static Texture* m_img4; }; // outside your class initialize the static member variables …

Member Avatar for CoolGamer48
0
172
Member Avatar for En1ro

You are not reading anything from the file, you only open the file and then enter an infinite loop incrementing j on every round. You must read in some data in order to compare the value of vardas. Furthermore, about [icode]while(!kd.eof())[/icode], please take a look in here [url]http://www.daniweb.com/forums/post155265-18.html[/url] And lastly, …

Member Avatar for En1ro
0
107

The End.