6,741 Posted Topics
Re: >I'm here to query you on a doubt I have in dynamic initialization. You sound like less of an idiot when you speak clearly. "I'm here to ask you a question I have about dynamic memory" is much better than trying to sound smart by using uncommon and inappropriate words. … | |
Re: It's all of that radiation. You'd better invest in a Geiger counter. | |
Re: >i dont know how to implement accessor and mutator functions. Accessor and mutator are just fancy terms for a function that gives you the value of a member and a function that sets the value of a member: [code] class test { int member; public: int accessor() { return member; … | |
Re: ><iostream.h> is deprecated No, it isn't. A deprecated feature has to have been a part of the standard in the first place. <iostream.h> was never a standard header. >With iostream you need to put std:: before cin and cout. There are three options for qualifying a namespace. First, you can … | |
Re: >cannt you pass the CONSOLE_INPUT straight into the function? Not the way you want to do it, no. | |
![]() | Re: >gimme I hate this word. >C/C++ What is this C/C++ language you speak of? There's no such thing as C/C++. There's C and there's C++, but no C/C++, as any knowledgeable user of both will gladly tell you. Anyway, to answer your pseudo-question/demand, go here: [url=http://mindview.net/Books/TICPP/ThinkingInCPP2e.html]Thinking in C++[/url] ![]() |
Re: I'm curious why you want to go to all of this extra effort when functions would do. But what the hell, look into pipes. Create a pipe for each program and read/write to it accordingly during run-time. | |
Re: >I hate it when people place the brace { on the same line as the expression Get over it. Style issues are a matter of opinion, and you shouldn't push your opinions on other people. >I wonder if that is hanging you up. That's legal C++. 0 will be returned … | |
Re: Remove the int from in front of rtotal. Type names are (for the most part) only used in declarations and type casts. Because your use is neither of those, it's a syntax error. Of course, the code you've posted has other syntax errors as well. | |
Re: The API function is called [url=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/keyboardinput/keyboardinputreference/keyboardinputfunctions/keybd_event.asp]keybd_event[/url]. It's not terribly difficult to learn how to use it with the reference available. So why not give it a shot and you'll learn something about computers and programming. There's nothing wrong with that. If you want someone to write a program for you … | |
Re: The dynamic declination flag was accidentally switched to EIEIO. Check your atomic memory pool for floaters because they're probably causing the kernel to pop. But be careful because the memory manager is volatile and could cause the entire pipeline to dump core. | |
Re: >to demonstrate a char array overflow. Array overflow is undefined. Your demonstration is non-sensical because the result could be anything. | |
Re: It sounds suspiciously like a memory problem such as a dangling pointer. They can be incredibly difficult to debug because sometimes everything works fine and sometimes it crashes miserably. Before you blame your system or the compiler, make sure your code is perfect. Otherwise you're showing nothing but arrogance in … | |
Re: Okay, and what have you tried? We don't do homework for you, we help you with specific problems (when the specific problem isn't "I need you to do my homework"). | |
Re: >1. design support for 'programming in the large' We let you write big programs. >2. a modern object model that supports concurrency: activities in objects replacing passive method calls We let you do more than one thing at a time. >3. formalised interaction between activities (dialogs) We force you to … | |
Re: >I guess I just did your homework for you. That's bad. That's not an edit, so you knew that you did his homework and you knew that it was bad [b]before[/b] you clicked submit. So were you trying to show off? If so, you failed miserably. | |
Re: [img]http://www.daniweb.com/certificates/badge17893.jpg[/img] | |
Re: >I am just getting started and can not find a Java equivalent to C++'s scanf command. You shouldn't be using scanf in C++. The best way to parse input remains the same for C++ and Java: read a line and then tokenize it. | |
Re: 3 seconds on google gave me a Java implementation. Shoo. | |
Re: Does the error repeat every time you try to build? If so, it's your code. If not, it's a fluke that happens occasionally. | |
Re: [quote]I would like to know how to send an AnsiString variable called "Data" to a template class function so that the calling block can immediately access the value associated with the AnsiString variable "Data" that is assigned to it in the template function after control is returned to the line … | |
Re: >Yes i'm compiling it as an .exe and it it runs fine. That doesn't answer the question. When you create a project in Dev-C++ you can choose a Win32 application or a Console application. You chose a console application, which automatically spawns a command prompt window for running the program. … | |
Re: >compiler says "main must return int" >teacher says it's fine Your compiler is right and your teacher is wrong. main has never returned anything but int in C or C++. If a compiler allows it then it's a non-standard extension to the language and you can't expect your code to … | |
Re: >I need to assign a value to a variable named in a sting variable. Why? Most of the time this problem can be solved differently by looking at it the right way. Since this appears to be C, it takes quite a bit of work to solve it properly, and … | |
Re: >there're gotta be a better way ... There isn't unless your system supports record-oriented files. Any solution will be a variation of what you were thinking of doing. Though naturally, any decent solution will take advantage of block reads and caching to avoid the performance hit of constantly reading and … | |
Re: >Seriously C++ days are numbered. You're an idiot. There were people like you who ignorantly thought that COBOL's days were numbered in 1974. Lo and behold, COBOL is still used quite a bit 30 years later. So, you're an idiot, and I won't waste my time explaining why since you're … | |
Re: >do you know ---> why this error happened?? Not with your incredibly sparse example. However, once I include <iosfwd> and do a using std::ostream, it compiles fine. | |
Re: One of your programs that you're writing? Or one of your retail programs that happens to like the debugging software that you have installed and lists that as an option when it panics? If it's the former, go to the forum for the language you're working with. If it's the … | |
Re: >it will take the ASCII value of a which is 97 We don't care whether you know what the integer values of the ASCII characters are. Stop assuming a specific character set. Geez, how many times do I have to repeat myself before you people get a clue? | |
Re: >why won't this work? Because it's dreadfully broken. Format the code properly, then read the errors when you try to compile. | |
Re: >Never use goto statements - it's very bad programming practice! Moo, tell me, how does it feel to be cattle? I mean, you have to be a part of the herd if you mindlessly believe what you just stated. *sigh* This argument is tiresome, so I'll leave you with this … | |
Re: I refuse to help you until you learn how to indent your code. You're using code tags, so the problem is on your end. I don't know if you're lazy, or just stupid, but either way it makes your code harder to read and I don't have time to reformat … | |
Re: Unless you want to do precise error handling and throw a message if the user enters something other than q or Q, you can simply place the entire processing code into an infinite loop and break if scanf fails: [code] #include <stdio.h> #include <stdlib.h> /* Main Program */ int main(void) … | |
Re: Deja vu, deja vu, the OP has some learning to do! Why start two threads with the exact same question? | |
Re: To insert a value into an array, you need to shift every value [b]after[/b] the location you want to insert. This way you make a hole for the new value. Of course, this can be a problem if the array is already full. You would most likely end up throwing … | |
Re: Well, since your code is so incomplete there's no telling what the error is. Are you including the proper headers? Are you accounting for the std namespace? Is everything declared before it's used? | |
Re: [quote] do you know anything about c++. or have you just created this site for fun. i though you people knew certain things, i guess i was wrong. how hard can it be for creating a my program [/quote] Bahahahahahahaha! That's a good one. "Here's my homework, do it for … | |
Re: >gets(str); /* Getting a dtring from the user */ I [b]know[/b] you didn't just use gets. You couldn't have. Nobody could possibly be that stupid after nearly 30 years of everybody with a brain screaming the peril of gets at the top of their lungs. >then call a function and … | |
| |
Re: >just wanna ask if c++ opendir,readdir and closedir code can be implemented in visual c++ They're not supported by the library, but you can write versions of them if you really want to using FindFirstFile and FindNextFile. | |
Re: >does C++ support regular expressions and/or regex matching? Not natively or through the standard library. However, boost has a regex library for C++. | |
Re: >'not all control paths return a value' [code] if (a == 1) { cout << "now returning a"; return a; } else if ( a < 4) { cout << "function call to b" << ha(b); } } [/code] If a is 1 then you return a, but if a … | |
Re: >How to show a list of options and allow the user to select the options by using arrow keys and enter. How to include your operating system and compiler in the question because manipulating the arrow keys is platform-dependent. | |
Re: Borland 4.5 supports the delay function IIRC. Include <dos.h> and pass it the number of milliseconds you want to pause: [code] #include <iostream.h> #include <dos.h> int main() { cout<<"Test 1\n"; delay(2000); // Two second pause cout<<"Test 2\n"; return 0; } [/code] | |
Re: >I'm wondering if theres a away to just print out the values after the decimal point. There's a library function in <cmath> called modf that breaks up a floating-point value into its constituent pieces. Alternatively, you could copy the value to an int (which truncates the fractional part) and subtract … | |
Re: >when you enter a number it will say you have use 10 k memory That's one hell of a number. >please someone help so me a example, please Please ask a coherent question instead of whatever it was you said in broken english. | |
Re: >I simply have to overload square brackets in order for a program to work. Why? It's considerably easier to overload the () operator to take two arguments instead of hack your way to a solution with the [] operator. But if you must know, you need to use a helper … | |
Re: >int chararry[12][10] = {"Jan", "Feb"} Your declaring an array of [b]integers[/b] but trying to initialize it with [b]strings[/b]. Do you see anything wrong with that? If not then maybe a strongly typed language like C++ isn't your cup of tea. |
The End.