6,741 Posted Topics

Member Avatar for bandm

You're using a Win32 application project when you want a console application project. Win32 applications expect WinMain instead of main.

Member Avatar for bandm
0
448
Member Avatar for galmca

Is there any reason you resurrected a seven month old thread to post ugly code? Be careful with your answer because it will dictate whether or not I close this thread (and my finger is on the big red button as it is).

Member Avatar for Narue
-1
364
Member Avatar for desidude

>fin >> isFirst; I think you mean: [code] fin>> val; [/code] isFirst doesn't strike me as a data variable, it seems more like a status variable. You don't even need it. Oddly enough, I didn't bother looking at Dave's code, but my solution is only slightly different (but it avoids …

Member Avatar for desidude
0
225
Member Avatar for Asif_NSU

Don't forget that a stringstream is still a stream. This should work for you: [code] #include <iostream> #include <sstream> #include <string> int main() { std::stringstream s ( "This is a test" ); std::string token; while ( s>> token ) std::cout<< token <<'\n'; // Clear the stream state s.clear(); // Rewind …

Member Avatar for Asif_NSU
0
924
Member Avatar for yaan

Use [url=http://www.daniweb.com/techtalkforums/misc.php?do=bbcode#imgcode]code tags[/url] for any future code. I've added them for you this time, but next time I may just feel the need to delete your post if you fail to do it properly. >After the ID and name are poped from the stack, I need the program to >automatically …

Member Avatar for Narue
0
100
Member Avatar for hinde

You surround the formatted code with [url=http://www.daniweb.com/techtalkforums/misc.php?do=bbcode#imgcode]code tags[/url].

Member Avatar for hinde
0
183
Member Avatar for logic321

>[edit]Moments after posting, I couldn't shake the feeling that someone >saw this and was planning to post a binary-tree version of the lookup. >::wierd:: That is wierd. Maybe you have binary search trees on the brain. I'm big into trees, but I would probably do it like this: [code] template …

Member Avatar for Narue
0
393
Member Avatar for Kob0724

>Do I just remove the semi-colon? Are you incapable of experimenting? It seems sort of silly that you're trying to be a programmer yet you can't even make such a simple decision as removing a single semicolon without running to us for permission. Here's a piece of advice. Rember it …

Member Avatar for Narue
0
179
Member Avatar for dark7angelx07

>couldnt you just reverse them without it? or is it needed? It looks like width is strictly for pretty formatting. Rather than assume the largest possible number of digits and suffer extra leading spaces, width is used to ensure that only a single space precedes the reversed number regardless of …

Member Avatar for Narue
1
649
Member Avatar for somer2412

It means you're using the wrong project type. You created a Win32 application (which requires WinMain instead of main) and then treated it as if it were a console application (by using main instead of WinMain).

Member Avatar for CrazyDieter
0
418
Member Avatar for Giant

>Here is a short version of my code that repeats the same error I just get a bunch of syntax errors. How about posting something complete that we can cut/paste and compile? By the way, your code as it is is filled with problems.

Member Avatar for Dave Sinkula
0
593
Member Avatar for shahid

I suggest you actually [b]read[/b] your C++ book before trying to write a program of any complexity. You have mistakes that should not be made by someone who has paid attention in class.

Member Avatar for Dave Sinkula
0
163
Member Avatar for mr. President

I only looked at the line you mentioned, but it sure is a doozy: [code] for ( int i= 0; int i > 100; i++); [/code] Remove int from the condition, you want the loop to iterate 100 times I assume, so it should be i < 100, and a …

Member Avatar for mr. President
0
136
Member Avatar for bluegirl
Member Avatar for durga prasad d

>What is vtable ? A fancy term for an array of function pointers. >How many vtables created for this sample. Maybe none. The virtual mechanism doesn't [b]have[/b] to be implemented using the vtable concept. However, if it did, the answer would probably be one, but it's implementation-defined.

Member Avatar for Narue
0
94
Member Avatar for JoBe

>length() was left in the string class for backwards compatibility with something The string class existed in C++ before the STL was adopted, so length() was kept for backward compatibility with existing code and size() added in a poor attempt to make string more like a standard container. >Also, size …

Member Avatar for Dave Sinkula
0
248
Member Avatar for cherryluscious

>hi here is the solution for your problem. Wonderful, yet another helpful bozo who's willing to teach beginners to be ignorant and rely on others to do their work for them. >run the above code and get the disired result Maybe, but then again, maybe not. Your entire program is …

Member Avatar for Narue
0
158
Member Avatar for Stanislaw

>is there a way to input a new usewr while the program is running? Yes, of course. Just maintain a list of valid users, and when adding a new user, append to the list. Unfortunately, without further detail about how you're going about things, I can't be more specific.

Member Avatar for tonakai
0
372
Member Avatar for cols

You're not likely to get an answer to a question in the Community Introductions forum. Might I suggest the [url=http://www.daniweb.com/techtalkforums/forum107.html]Hardware->Peripherals[/url] forum? Before posting, it's a good idea to find the most relevant forum for your post.

Member Avatar for jwenting
0
168
Member Avatar for pjdc

Unless Dani has changed it, you need 10 posts before the full feature set of membership is available.

Member Avatar for Dani
0
114
Member Avatar for JoBe

>Am I correct that the way "char* &p" is written, that this is because the parameters of sort2 are array's of pointers No, they're references to pointers to char. The reference syntax is required to allow the function to rebind p and q and have the changes reflected back in …

Member Avatar for JoBe
0
370
Member Avatar for avgoddess
Member Avatar for shre86

>i am needed to represent an array using pointers only That suggests that you're required to use pointer arithmetic and dereferencing rather than subscripting. But, because the requirements clearly say "array", and not "dynamic array", or "simulated array" (granted, most teachers aren't intelligent enough to make the distinction), I would …

Member Avatar for Narue
0
191
Member Avatar for jakejacobson

Use code tags. I've added them for you this time, but next time I won't be so nice about it. >but the book's name, author, and isbn are all garbage That's no surprise. You're initializing the string data of the new node with the addresses of local arrays. When the …

Member Avatar for Rashakil Fol
0
333
Member Avatar for gmrod

Today 06:41 PM gmrod Today 06:43 PM gmrod Today 06:48 PM gmrod Today 06:56 PM gmrod Today 07:08 PM gmrod Today 07:10 PM gmrod Much ado about nothing, I see. For future reference, you can edit your posts. It's generally a better practice than flooding the thread with pointless additions.

Member Avatar for Narue
0
503
Member Avatar for M Tritt

>for (col; col < size; col++) { You're half way there. Now, actually assign 0 to col instead of just evaluating whatever indeterminate value is already there.

Member Avatar for Narue
0
274
Member Avatar for M Tritt

>What's wrong???? You created a new thread when you have an existing thread with [B]THE SAME QUESTION![/B] That's what's wrong. And this thread is locked; please direct further replies to the original thread. Thank you.

Member Avatar for Narue
0
110
Member Avatar for gluber

Locked how? You can set it to be read-only and hidden using SetFileAttributes. That's a quick and easy way to prevent simple viewing of and writing to the directory: [code] #include <stdio.h> #include <stdlib.h> #include <windows.h> void werror ( void ) { char msg[BUFSIZ]; DWORD err = GetLastError(); FormatMessage ( …

Member Avatar for Narue
0
106
Member Avatar for cpp noob

It's trying to tell you to replace your old ass compiler with something that conforms to the C++ standard. Let me guess, your operating system is Windows XP, right? >unable to open file "c0s.obj" Go to Options, Directories and make sure that you see something like this sitting around there: …

Member Avatar for cpp noob
0
305
Member Avatar for mina1984

>could somebody please simplify it for me? No, but we [b]can[/b] help you to understand it better if you'll do more than offer vague references to general techniques.

Member Avatar for Rashakil Fol
0
205
Member Avatar for shakoush2001

A brief search of google gave me [url=http://www.libpng.org/pub/png/pngaptk.html]this[/url]. Alternatively, though nobody wants to do this because it requires "work", is download the PNG specification from [url]www.wotsit.org[/url] and program your own handling routines.

Member Avatar for Narue
0
194
Member Avatar for Charliebot

When you name your files, you can choose to use a .c extension. Or you can go to the Project->Properties dialog, select C/C++, then Advanced, and next to Compile As, select Compile as C Code to ensure that you're actually compiling as C.

Member Avatar for Narue
0
115
Member Avatar for bandm

>They really form the basis of all the rest of visual studio etc.. Wait, how does Borland software form the basis of Microsoft software? Are you making some silly connection that the rest of us can't see? While you're at it, why not recommend Cfront as long as you're trying …

Member Avatar for Narue
0
207
Member Avatar for BubbleWrap

What kind of mouse is it? Have you cleaned the hardware? Have you tried another mouse? Have you tried another mousing surface? What other troubleshooting steps have you gone through?

Member Avatar for whirlwind
0
347
Member Avatar for Narue

Since C and C++ are different languages, would it benefit Daniweb to split the C/C++ forum into separate C and C++ forums?

Member Avatar for Electrohead
0
609
Member Avatar for Narue

For those of you who don't know, Daniweb has an IRC server. I'm there a lot, and I don't see any of you. That's not good because I'm there, of course. Real time chat with the resident guru ([B]shamless[/B]) will make you smarter ([B]utterly shameless[/B]) and cooler ([B]words cannot express …

Member Avatar for Dave Sinkula
0
145
Member Avatar for Monte
Member Avatar for wizmonster
0
736
Member Avatar for Lunaticrr

When you get a syntax error, it's customary to post the code as well as the error. :rolleyes:

Member Avatar for Lunaticrr
0
352
Member Avatar for el matto
Member Avatar for Catweazle
0
319
Member Avatar for Tetsu

>It is skipping some of the datas. Which parts of the data are being skipped? Help us to help you by narrowing down the problem as much as possible. Otherwise we'll just ignore you.

Member Avatar for Tetsu
0
472
Member Avatar for JoBe

>Write a ClassTemplate for a linked list. I think it means write a linked list class that uses templates for the type, not whatever you were trying to do with a vector. Infusing myself with the power of concentrated ugly, I wrote this for you. Maybe you can glean something …

Member Avatar for Dogtree
0
228
Member Avatar for tat2dlady

>But, how do you see if one string is less than the other? strcmp returns one of three values: 0 if the strings are of equal length and content, a value less than 0 if the first string is shorter or smaller in value than the second string, and a …

Member Avatar for Dogtree
0
1K
Member Avatar for Wenshere

Your question is vague, and there are multiple answers. Can you be more specific as to how you intend to use a?

Member Avatar for Dogtree
0
113
Member Avatar for TogeBB
Member Avatar for CMania

>HOW DO I WRTIE THE CODE FOR THIS TASK? I believe your caps lock key is stuck. Just like any non-trivial program, you break it up into manageable chunks. Instead of trying to do everything at once, start by writing the program without using separate processes. That's simple, so once …

Member Avatar for Narue
0
221
Member Avatar for Scuuba

Enumerations are just convenient sets of named integers. For example, in your code, scalene is 0, isosceles is 1, equilateral is 2, and noTriangle is 3. Printing out one of those low values as a char will likely give you something funky. You can fix it by returning a string …

Member Avatar for Scuuba
0
209
Member Avatar for CompiConQuiso

>Can anyone help me? Sorry, I don't help people who spam as many forums as they can with their problem. You obviously don't trust the answers you'll get here, or you wouldn't have posted on other sites, so go there to get your help.

Member Avatar for Narue
0
202
Member Avatar for apcxpc

For any user-defined type, you can overload operator<< for output to ostreams: [code] ostream& operator<<(ostream& out, const Relation& r) { return out<< r.toString(); } [/code] Then all you need to do is define Relation::toString to return a string in the format that you want. Pretty simple really, and overloading operators …

Member Avatar for Narue
0
3K
Member Avatar for theinsaneone

>Why can't you program it yourself? Too lazy to be bothered? Too stupid to figure it out? We get the round robin homework problem a lot, and I have yet to see someone show an attempt at it.

Member Avatar for Narue
0
114
Member Avatar for some one

How is your code close? You don't use loops to handle more than one record, you don't use a structure to store a single record, and you don't have a function that processes the records into a bill. I think you should talk to your instructor so that you have …

Member Avatar for Narue
0
246

The End.