560 Posted Topics

Member Avatar for Labdabeta

If you are using Windows it's pretty simple, but not exactly guaranteed to not "flash" a console window for a moment. What [b]sfuo[/b] meant is you can tell your compiler to not spawn the console window. It's a compiler switch. Now, this is the "dirty" way... [code] #include <Windows.h> int …

Member Avatar for Labdabeta
0
7K
Member Avatar for TimBob12
Member Avatar for honeythigh

1 : C++ was my first programming language, it takes a while (a long time), heh that "steep learning curve" thing really doesn't mean it gets difficult to understand. But be prepared to put some time into it. 2 : I think it is, but I'm not a game programmer …

Member Avatar for honeythigh
0
411
Member Avatar for vjackcon

Depends on what Operating System you are using. For Windows: [url]http://www.microsoft.com/express/Windows/[/url]

Member Avatar for Ancient Dragon
0
115
Member Avatar for xander91

Where to ask? The proper forum, of course. Advice? Of course. Although you don't seem like the type, don't ask us to write code for you. Meaning, you have to show some effort to get help. Post the code you have, and tell us what you're having problems with. As …

Member Avatar for pseudorandom21
-1
74
Member Avatar for arunp_eagle

[url]http://msdn.microsoft.com/en-us/library/bb525388(v=vs.85).aspx[/url] Try testing the return value. There is also an example on that page.

Member Avatar for pseudorandom21
0
82
Member Avatar for ogrishmania

I'm not sure I agree with finding code on the internet and trying to use it. The way for you to understand it is to write your own code. If you run into problems while trying to do your own homework, please let us know and we'll kindly try to …

Member Avatar for WaltP
0
2K
Member Avatar for pseudorandom21

[url]http://www.boost.org/doc/libs/1_46_0/libs/smart_ptr/shared_ptr.htm#ThreadSafety[/url] This section somewhat confused me, in my code I have a matrix of shared_ptr's pointing to an entirely thread-safe class. But the shared_ptr documentation says it is only as thread-safe as the built-in C++ types. Does this mean that if I read/write to my thread-safe class using shared_ptr's at …

Member Avatar for mike_2000_17
0
185
Member Avatar for pato wlmc

You will need the debug DLLs for the debug version and the release DLLs for the release version.

Member Avatar for pato wlmc
0
118
Member Avatar for madval88

Reading here may help: [url]http://svn.scipy.org/svn/numpy/trunk/doc/neps/npy-format.txt[/url]

Member Avatar for madval88
0
769
Member Avatar for Transcendent

What happens when you do: [code] char text[20]; cin >> text; [/code] ?? I really don't know, but I think it will allow someone to enter too many characters and 'sploit the program. [code] const std::streamsize BUFFER_MAX = 1024; char buffer[BUFFER_MAX] = {0}; std::cin.getline(buffer,BUFFER_MAX,'\n'); [/code]

Member Avatar for caut_baia
0
152
Member Avatar for jasoncastro

I don't think there is a standard way to do this (if I'm wrong I would like to know) so you will probably have to rely on the operating system. If you're using Windows/Linux the exact functions will vary. Windows: [url]http://msdn.microsoft.com/en-us/library/078sfkak(v=vs.80).aspx[/url]

Member Avatar for jasoncastro
0
2K
Member Avatar for akase2010

I think he needs to know how to dynamically allocate the array... [code] char *buffer = NULL;//<-- good style dictates initializing to nullptr. buffer = new char[1024];//<-- array of 1024 characters. //use array with familiar notation delete [] buffer;//<-- delete the allocated memory so you don't "leak" it. buffer = …

Member Avatar for template<>
-2
125
Member Avatar for sharksaw40

Be able to take advantage of every feature of C++, including the STL. Study Algorithms, Data structures, and other misc. Computer Science stuff--like Artficial Intelligence, etc. For instance a DFA/NDFA/FSM comes in REAL handy sometimes: [url]http://en.wikipedia.org/wiki/Finite-state_machine[/url] Calculus too.

Member Avatar for sharksaw40
0
279
Member Avatar for valkyrie

You could use instead: [url]http://cplusplus.com/reference/clibrary/ctime/time/[/url]

Member Avatar for template<>
0
203
Member Avatar for kayhantolga

I hate to spring this kind of things on you, but if you expect some Americans to look at your code (which I am a native speaker of), you may want to read/write it like us too.

Member Avatar for pseudorandom21
0
168
Member Avatar for negneg
Re: Help

Place your code between [noparse][code] and [/code][/noparse]

Member Avatar for Software guy
0
149
Member Avatar for wingmark

[url]http://www.cprogramming.com/[/url] //<-- not too bad. [url]http://www.cplusplus.com/doc/tutorial/[/url] //<-- didn't use it, probably would now. [url]http://www.functionx.com/cpp/[/url] //<-- not the best in my opinion.

Member Avatar for Labdabeta
0
111
Member Avatar for atticusr5

I think the pages for the functions you're using here will help: [url]http://www.cplusplus.com/reference/stl/list/[/url]

Member Avatar for GDICommander
0
187
Member Avatar for maikens

In your example: [quote][icode]std::tolower(*end)[/icode][/quote] tolower is in <cctype> and is a C function.

Member Avatar for pseudorandom21
0
237
Member Avatar for zxzniczxz

You have to attempt it, and if you run into trouble we may offer some help. Basically we don't do your homework for you. I will help you with this at least, if 'n' grows even slightly large you will need a very large data type to store the sum. …

Member Avatar for hag++
0
149
Member Avatar for atticusr5

I tend to think it would be a problem with reading the file. This will cause problems: [quote][icode]while(!Infile.eof())[/icode][/quote] Try instead: [code] std::string name; unsigned long age; while( inFile >> name >> age ) { //.. use it. } [/code] Otherwise consult some file IO reference material.

Member Avatar for atticusr5
0
182
Member Avatar for cousinoer5

I'm taking a look at some of the code, my initial thoughts on your first problem are that the file stream has error bits set that need cleared. Firstly as a matter of good style let's initialize your char array to '\0'. [icode]char fname[30] = {'\0'};[/icode] What this code does …

Member Avatar for cousinoer5
0
217
Member Avatar for VasquezPL
Member Avatar for VasquezPL
0
96
Member Avatar for kas04

It looks like you need to know how to do this, but I'm kind of unsure, because it's very simple to do... [code] for(size_t i = DIM1 - 1; i > -1; i--) { for( size_t j = DIM2 - 1; j > -1; j-- ) ;//... } [/code]

Member Avatar for kas04
1
138
Member Avatar for beejay321

No you don't need global variables you can pass by reference or pointer, but I would suggest making a variable "static". [url]http://msdn.microsoft.com/en-us/library/s1sb61xd(v=vs.80).aspx[/url] Note that the "static" keyword may behave differently than you expect in classes. ex: [code] int CurrentTotal(int n) { static int total = 0; total += n; return …

Member Avatar for sfuo
0
140
Member Avatar for triumphost

For the 10 seconds to enter a password thing you will most likely want to start a new thread that waits for 10 seconds to grab some input.

Member Avatar for triumphost
0
176
Member Avatar for grebote

I noticed you have a lot of variables in one structure, I usually try to nest some structures like this: [code] struct CategoryOne{ int a; int b; std::string s; }; struct CategoryTwo{ bool tf; double d; }; struct AllMyData{ CategoryOne catOne; CategoryTwo catTwo; }; [/code] I am only posting this …

Member Avatar for grebote
0
222
Member Avatar for htq2511
Member Avatar for pseudorandom21
0
168
Member Avatar for MaDo4

If you intend to skip whitespaces I suggest you read using operator>> In your original code you have both: [code] getline(inFile,str); //and inFile >> str; [/code] Perhaps re-writing your loop condition to: [code] while(inFile >> str) { } [/code] and the operator '>>' will read in one block of non-whitespace …

Member Avatar for MaDo4
0
122
Member Avatar for writerervin
Member Avatar for FrancisLazo

Place code between the code tags, which are [ code] and [ /code] (without the space) I would consider using a matrix to represent the seat data, and a structure holding the information for each seat. matrix = 2 dimensional array For the letter-index system, I would simply create an …

Member Avatar for FrancisLazo
0
3K
Member Avatar for watery87

I agree with jonsca, the string class is managing that memory and implementations vary. [url]http://www.cplusplus.com/reference/clibrary/cstring/strtok/[/url]

Member Avatar for mike_2000_17
0
162
Member Avatar for fat_flying_pigs

Are you aware this is making an array of pointers? [icode]Event *events[MAX];[/icode] I think it would be best for you to review the basics of pointers and dynamic memory allocation, you leak memory for the Event you allocated. Some better style may help you detect errors, by initializing the array …

Member Avatar for pseudorandom21
0
155
Member Avatar for lochnessmonster

Microsoft unicode stuff. [url]http://msdn.microsoft.com/en-us/library/aa272960%28v=vs.60%29.aspx[/url] You will likely opt to use either the "char" type of string, or the "wchar_t" type. Visual Studio provides a std::wstring. [url]http://msdn.microsoft.com/en-us/library/wt3s3k55%28v=vs.71%29.aspx[/url] Note that wstring is a basic_string<> templated to wchar_t. You may also opt to convert the "char" string to "wchar_t". See MultiByteToWideChar: [url]http://msdn.microsoft.com/en-us/library/dd319072[/url]

Member Avatar for pseudorandom21
0
179
Member Avatar for pseudorandom21

Is there a way to define a property with default get/set functionality for a variable?

Member Avatar for Momerath
0
99
Member Avatar for Sahilroy
Member Avatar for spoonlicker

Unfortunately I don't think it's possible to have two windows in focus at the same time on Windows. I don't think the OS works like that.

Member Avatar for peter_budo
0
2K
Member Avatar for dennis.d.elston

I'm just wondering, is there a way to compute the arithmetic mean without using a summation like the normal algorithm does?

Member Avatar for dennis.d.elston
0
190
Member Avatar for COL_Milkshake
Member Avatar for nazerb

It can be done but it's usually not easy, nor is it intuitive. I have "scraped" a website with C++, which means downloading a copy of the web page's HTML. For your particular problem, wouldn't ftp be easier to use than HTTP ? Scraping is a bad way to do …

Member Avatar for pseudorandom21
0
127
Member Avatar for manongjulius

[quote][code]bubblesort(array[],size);[/code][/quote] to [icode]bubblesort(array,size);[/icode]

Member Avatar for manongjulius
0
289
Member Avatar for scarlettmoon

I think you're missing some program code, and tell us exactly what problems you are experiencing, and also what you're trying to accomplish.

Member Avatar for scarlettmoon
0
303
Member Avatar for pseudorandom21

I found this excellent video on one of Microsoft's websites: [url]http://msdn.microsoft.com/en-us/ff728575[/url] I'm really just wondering how to organize the window procedures for my Dialogs/Buttons/etc. Would one normally after creating a dialog throw the window procedure into a new file? I don't like tiny bits of code in different files, so …

Member Avatar for BitBlt
0
159
Member Avatar for annnDi

In win32 it is in either LPARAM or WPARAM, I've forgotten (don't use it)--so, I'll happily google that for you so that we both learn. I'm hoping you can apply this to your MFC application. Ok, MSDN (which you should be using as a reference) says: [url]http://msdn.microsoft.com/en-us/library/ms646276%28v=vs.85%29.aspx[/url] WPARAM is the …

Member Avatar for annnDi
0
399
Member Avatar for darkalfx

I don't think this is correct, I've never seen anyone try to do this, either: [quote] [code] inFile.read((char*)&Value1, sizeof(string)); [/code] [/quote] It just looks like a really bad idea, with the string not being an array of characters and all, what with the functions and what-not in the class.

Member Avatar for darkalfx
0
1K
Member Avatar for skinwah

Oh and that loops 201 times, starting at zero and continuing until = 200 = 200 + 0 (0 counts as one also) thus 201.

Member Avatar for pseudorandom21
0
270
Member Avatar for ComicStix

Personally I started programming in C++ while I was in middle school, it was a beast but after a while (i would guess a few weeks) studying at home after school (programming didn't suck like my classes), I was able to put together some decent programming logic with it. The …

Member Avatar for rscubelek
0
229
Member Avatar for VasquezPL

If your C++ code consists of functions in a header file, then include the header file in the form you wish to use it in, and call the functions. If your C++ code consists of class/es in a header file, then include the header file and use the class. I …

Member Avatar for VasquezPL
0
1K
Member Avatar for Gregor97

I have to stand up for Ivor Horton's Beginning Visual C++ series. The 6.0 version of his book has served me well. The 2010 edition teaches C++/CLI as well as C++. I think he has a title that is pure C++, but you may want to look around for it …

Member Avatar for alex55
0
140

The End.