3,183 Posted Topics

Member Avatar for MARKAND911
Member Avatar for Dani

> Those that have broader ideas and need detailed and solid information will always use forums. Will they still use forums if none of the good forums can fund themselves well enough to stay up?

Member Avatar for rjdoll77
0
251
Member Avatar for carmen.golz.9

It's syntactically incorrect since the string literal wasn't properly started, but otherwise the code is legit C++: cout << "Concert4 Program Answers.\n\n"; What concerns in particular do you have about the statement?

Member Avatar for deceptikon
0
192
Member Avatar for wildplace

[QUOTE]but if I don't use stdafx. vs would give me a precompiled header error.[/QUOTE] You can turn off precompiled headers in the project settings. [QUOTE]it is a win32 console project..[/QUOTE] Anything except an empty project will add Microsoftisms. When you're trying to write portable code, I'd recommend starting with an …

Member Avatar for deceptikon
0
2K
Member Avatar for Purav_1
Member Avatar for martin3885

> I'am curious if it is possible and how to add drad & drop functionality to a window of an external application. Only of the external application supports drag and drop, and you'd need to figure out how to make drag work between them. This strikes me as a tricky …

Member Avatar for rubberman
0
244
Member Avatar for V3N0M

The only obvious potential issue at a glance is this: while (cWhoWon == ' '){ Your character literal is two spaces rather than one.

Member Avatar for V3N0M
0
315
Member Avatar for ali4084

Do you really want to terminate the program or just terminate the input process? The latter strikes me as more intuitive: int main() { int arr[0], i, sum = 0; cout << "Enter values: "; for (i = 0; i < 10; i++) { int input; if (!(cin >> input) …

Member Avatar for deceptikon
0
229
Member Avatar for mandip.malla

> so plz send me source code No, do your own homework. If you have specific questions or problems, feel free to ask those, but Daniweb is not your personal cheating service.

Member Avatar for deceptikon
0
34
Member Avatar for Ancient Dragon

Possible, yes. We technically could extend Markdown to support this feature, but I suspect Dani doesn't want to lock us into a specific version of the libraries because that would make upgrades quite a bit harder to apply.

Member Avatar for jeffcogswell
0
263
Member Avatar for Rahul47

`*p=&a` is a type mismatch if you want to flatten the array. Try `*p = &a[0]` instead. Also note that this trick isn't strictly portable due to how C restricts pointers walking past the end of an array. It'll work on every implementation I'm aware of though.

Member Avatar for Rahul47
1
204
Member Avatar for dendenny01

> C99 concept of variable array is not accepted in Recent Compilers .They give errors like" Constant Expressions required in Function main on line 9" Then you're not compiling as C99. The compiler also must support C99, which not all recent compilers do. Further, it looks like you're using Turbo …

Member Avatar for dendenny01
0
347
Member Avatar for Damian_2

How are the weapons stored? Are they always a string in display format? Because it would be easier to have a weapon class that separates these things and makes it easier to work with: #include <algorithm> #include <cstdlib> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; struct …

Member Avatar for Damian_2
0
341
Member Avatar for Dani

Continuing milil's tangent, there *are* experts in the Java forum, for example. However, the questions on average are gradually becoming dumber, lazier, and a waste of time. So encouraging experts to participate more often should start with ensuring that quality questions are asked. The problem is that this is difficult …

Member Avatar for Dani
0
149
Member Avatar for Neelam_1

You can, but static data member definition isn't exactly intuitive without a fairly good understanding of the object model: class outside { public: class inside { public: static int x; // Declare as normal }; }; // Define using name resolution int outside::inside::x = 123;

Member Avatar for Neelam_1
0
276
Member Avatar for Royal_1

The assignment uses a lot of words for not a lot of work. That's a good thing, because it's very detailed, and all you need to do is put it in UML/code form. So now for the obligatory "what have you done"? It's against Daniweb rules to post just a …

Member Avatar for Slavi
0
742
Member Avatar for Rahul47

The last two would be recommended for not wasting memory. However, there are two questions that determine which you use, or if you want to go with dynamic memory allocation instead: 1. Do you intend to modify the string? 2. Do you indend to grow the string or is the …

Member Avatar for mathematician
0
131
Member Avatar for Rahul47

> Someone please point out where is loophole in my knowledge. The missing link is sequence points and undefined behavior. In `c=(--a)+(--a);`, `a` is being modified multiple times between sequence points, which invokes undefined behavior. The compiler is under no obligation to do anything predictable. Your second attempt removes the …

Member Avatar for N1GHTS
0
413
Member Avatar for Learner010

Because `10, 20, 30` does nothing more than evaluate to `30` due to how the comma operator works. `30` is an integer literal, which isn't compatible with a pointer to `int` unless you use a cast to make it an address: int *p = reinterpret_cast<int*>(30); This compiles, but it's not …

Member Avatar for deceptikon
0
161
Member Avatar for davy_yg

> I don't really means what cloud computing really means. It's nothing more than a marketing term for distributed computing. The internet is the quintessential cloud.

Member Avatar for rubberman
0
255
Member Avatar for shakin

> C... is a fickle beast ya know. Sounds more like your file format is inconsistent. Any language will be fickle when the incoming data is difficult to parse. Do you have a way of determining whether column 2 will contain embedded whitespace? That's the key question here.

Member Avatar for N1GHTS
0
260
Member Avatar for sfuo

Let's start with the design of the class. timer aTimer; aTimer.Start(); This is kind of an equivalent design issue, but in many cases one would want the timer to start immediately without having to explicitly call Start(). Perhaps a constructor parameter that tells it to start or not? while( aTimer.GetTicks() …

Member Avatar for dexblack_1
0
12K
Member Avatar for Ketan022

> But what if unknown coder is smart enough to change hidden data of class? Then unknown coder will be breaking the contract and if the hidden data of the class ever changes, will suffer the consequences of not strictly using the public interface provided by the class author. I …

Member Avatar for mike_2000_17
0
175
Member Avatar for khan.arshad3

Sounds like a CAPTCHA failure. You should be able to refresh the images to get something you can easily recognize. CAPTCHAs are used to restrict registration to actual humans and reject bots.

Member Avatar for rjdoll78
0
229
Member Avatar for Learner010

I'd probably go with a simple licensing mechanism: using System; using System.Globalization; namespace BasicLicense { public class License { public string ProductCode { get; set; } public DateTime ExpiresOn { get; set; } public bool IsValid { get; set; } public License(string licenseCode, string productCode, string registeredTo) { ExtractLicense(licenseCode, productCode, …

Member Avatar for Deep Modi
0
359
Member Avatar for visakh_Here
Member Avatar for castajiz_2

Two options. One is a verbatim string: var query = @"select beggining_school, end_school FROM Student,student_weekend,Weekend WHERE Student.ID=student_weekend.studentID AND student_weekend.WeekendID=Weekend.ID" Note that indentation is significant in the string, as are newlines. The other, my preference, is literal concatenation because there aren't any "hidden" characters: var query = "select beggining_school," + "end_school …

Member Avatar for deceptikon
0
161
Member Avatar for kshahnazari

[Isolated Storage](http://msdn.microsoft.com/en-us/library/3ak841sy(v=vs.110).aspx). It's not completely protected from user access, but not as open as arbitrary files.

Member Avatar for deceptikon
0
160
Member Avatar for cacolukia
Member Avatar for cacolukia
0
187
Member Avatar for khan shahid

http://www.lysator.liu.se/c/bwk-tutor.html Do you have anything specific you're interested in or just C in general.

Member Avatar for deceptikon
0
286
Member Avatar for nitish.mohiputlall
Member Avatar for Moschops
0
2K
Member Avatar for Sanjeetjmp

> INLINE FUNCTIONS DON'T USE STACK. THEREFORE, EXECUTION TIME IS LESS.HOWEVER, THE STATEMENTS IN THE FUNCTION ARE SUBSTITUTED WHENEVER THE FUNCTION IS CALLED.INLINE FUNCTIONS ARE ALWAYS SHORT. Many assumptions there, tamilselvi, and none of them are safe: http://www.gotw.ca/gotw/033.htm

Member Avatar for Ancient Dragon
0
219
Member Avatar for Rahul47

MASM is just an assembler, IIRC. Are you also running a linker after assembling source into object code?

Member Avatar for Rahul47
0
1K
Member Avatar for Start4me

> I can't figure out how to clear the "MathDep" - previous collection of items before importing the collection of items again. MathDep.Clear() Since you're using a hardcoded collection, you can just clear `MathDep` when you clear `ListBox1.Items`.

Member Avatar for Start4me
0
248
Member Avatar for amcath
Re: C++

> manually I get the answer as 6 , but the compiler gives as -4 . how? Because modifying a variable multiple times between [sequence points](http://en.wikipedia.org/wiki/Sequence_point) is undefined behavior. The compiler can do whatever it wants. Further, upon invoking undefined behavior, the entirely of the program is henceforth undefined as …

Member Avatar for deceptikon
0
247
Member Avatar for chubbyy.putto

What are the contents of `findNum`? That's somewhat critical as to your results. However, it strikes me that you'd want to split it into two loops to get a more reader friendly output: cout << "Positive: "; for (int i = 0; i < num; i++) { if (findNum[i] > …

Member Avatar for Ancient Dragon
0
175
Member Avatar for rowen_1

> Only char has a guarenteed size, which is 1 byte with a range of -127 to 126. Off by one. The guaranteed size is -127 to 127.

Member Avatar for deceptikon
0
176
Member Avatar for IndyItMan

I can think of several ways to do this, but more detail would help. What is this algorithm ultimately doing? Describing what you want to accomplish rather than *how* you want to accomplish it works better when looking for alternative methods.

Member Avatar for IndyItMan
0
237
Member Avatar for MARKAND911
Member Avatar for sohail.butt.144

Please ask a [smart question](http://www.catb.org/~esr/faqs/smart-questions.html). Just posting your homework assignment is insufficient.

Member Avatar for lala56565
0
187
Member Avatar for Perry_1

> We use it at my company, but it doesn't get any more work done than the less "structured" methods we used in my previous position Agile is a buzzword for a red tape process. The more red tape you have, the longer it takes to get shit done, regardless …

Member Avatar for Perry_1
0
139
Member Avatar for qalooc

[Do provide evidence of having done some work yourself if posting questions from school or work assignments](http://www.daniweb.com/community/rules)

Member Avatar for deceptikon
0
51
Member Avatar for castajiz_2

Let's start with one quick clarification, XML is a *text* format. So technically you can save XML to a .txt file. ;) > I just can t see xml being a advanced technology for data saving and transportation. That's because it's not. XML isn't the most human readable format out …

Member Avatar for deceptikon
0
224
Member Avatar for frew

Good luck. Feel free to ask for help when you have a question other than *nothing at all* or "I don't know where to start". :rolleyes:

Member Avatar for deceptikon
0
45
Member Avatar for folabidowu
Re: C++

> I have done something but got confused along the line. Don't you think it would be better to post what you've done and then explain the confusion you have rather than just post your assignment and hope someone can read your mind?

Member Avatar for cherrymae.calma
0
276
Member Avatar for CoolAtt

This is a quirk of the C++ object model. Since the member function isn't virtual, the compiler knows exactly what function to call and doesn't depend on the object instance being valid. Technically, all non-virtual member functions are shared under the hood (virtual member functions work through a lookup table …

Member Avatar for CoolAtt
0
320
Member Avatar for cherrymae.calma

Headers provide declarations for the library objects and types you use. C++ requires a declaration to exist, and because it would be a pain (not to mention non-portable) to declare things manually, the headers are provided to make your life easier.

Member Avatar for cherrymae.calma
0
122
Member Avatar for hsasgh

Since you're posting to a C++ forum, I'm assuming you know at least rudimentary C++. So the good news is that when you need a program, you can write it. The bad news is that we won't write it for you. That would be cheating at what is clearly homework.

Member Avatar for deceptikon
0
145
Member Avatar for KushMishra
Member Avatar for srao1

I wouldn't recommend using `%s` unless you can guarantee that the fields won't contain embedded whitespace. Further, you should always use a field width for string specifiers in `scanf` to avoid buffer overflow. Ignoring the possibility of quoted fields that contain embedded tabs, it's straightforward to read a line with …

Member Avatar for Ancient Dragon
0
6K

The End.