6,741 Posted Topics
Re: [QUOTE]The idea of a "short" variable name only made sense when memory was very expemsive and the maximum was only 640K RAM.[/QUOTE] Um, no. The idea of a "short" variable name still makes sense because names that are too long are still hard to type and still tend to obscure … | |
Re: [QUOTE]I can't flag the post as bad as it is not a post it is a reputation comment.[/QUOTE] You can always PM a moderator or admin with any concerns. We won't bite, I swear. ;) But as far as reputation goes, it's inherently subjective, so we'll typically not retract rep … | |
Re: [QUOTE]You have to go into non-standard specialized code that most compilers do not contain.[/QUOTE] You say that as if the code isn't already completely non-standard and clearly based on libraries supported by Turbo C. Just say "use getch()" and be done with it, since this is a time when getch() … | |
Re: [QUOTE]so what is this problem ?[/QUOTE] Lack of understanding about how the command prompt in Windows works. Yes, you need to type Ctrl+Z on a line by itself for EOF to be properly signaled in your program. | |
![]() | |
Re: When the problem description includes "prints really weird lines" then the problem is very likely to be uninitialized strings. I didn't run your code, but I would guess that it stems from writing sporadically to [ICODE]name[/ICODE] with the index [ICODE]i[/ICODE]. [ICODE]i[/ICODE] will increment whether you copy to [ICODE]name[/ICODE] or not, … | |
Re: [QUOTE]But......The thing is, i am the only active one there.....[/QUOTE] Yes, IRC hasn't grown much because every new person joins and then leaves in disgust at how inactive it is, thus continuing the vicious cycle. :icon_rolleyes: | |
Re: [QUOTE]No user-defined function can run outside main().[/QUOTE] Assuming you mean that no user-defined function can run before main (ignoring that you seem to have misunderstood the OP), consider this: [code] #include <iostream> class foo { public: foo() { std::cout << "Me first!" << std::endl; } } obj; int main() { … | |
Re: Exit code 0xC0000005 is an access violation. Your code is broken, but you can search for places where you're accessing an array out of bounds or an uninitialized pointer. Those are the two most common causes of an access violation. | |
Re: [QUOTE=zeroliken;1733103][CODE]if (ans == "begin")[/CODE] you can use strcmp from string.h library[/QUOTE] ans is an std::string object, the == operator is properly overloaded, so this test is correct. The problem, I suspect, is that the code requests input twice and the OP has incorrect expectations. [quote] Any help would be greatly … | |
Re: [QUOTE]Can I use my own code that I slapped a GPL on and provided to sourceforge in my own commercial application?[/QUOTE] What does being commercial have to do with anything? The GPL doesn't stop you from charging money, it's all (mostly) about the openness of the source code. Ideally you … | |
Re: The console isn't meant to support graphics engines. If you want graphics, get a graphics library where you can use tricks like double buffering to avoid the flicker effect. If you want to use ASCII art graphics, be prepared to suffer the limitations of the console. It's that simple. | |
Re: [QUOTE]I guess the reputation feature must have been removed[/QUOTE] It wasn't removed, it just looks different. On every post you'll find an up and down arrow along with a counter. The counter is the number of people who have clicked the arrows to vote on a post (positive and negative … | |
Re: [QUOTE=DJSAN10;1731903]I am not sure of this. But see if you can use the following somewhere [CODE]scanf("%[^\n]");[/CODE] This code skips new line[/QUOTE] Actually, it expects a single character that isn't a newline. Skipping a newline would look like this: [code] scanf("%*[\n]"); [/code] However, that doesn't accomplish what the OP wanted, which … | |
Re: [QUOTE]This code is compile without any errors in my Visual Studio 2010 Ultimate.[/QUOTE] C++ is not defined by Visual Studio 2010 Ultimate. For example, on GCC your code fails with two errors: [CODE=text]main.cpp:6:3: error: 'ptr' was not declared in this scope main.cpp:29:16: error: 'system' was not declared in this scope[/CODE] … | |
Re: You've got the right idea, just make sure the details are solid: [code] #include <stdio.h> #include <stdlib.h> #include <string.h> struct record { char name[32]; double value; }; int compare(const void *a, const void *b) { const struct record *pa = a; const struct record *pb = b; int diff = … | |
Re: OP clearly has no intention of doing any work, which means this violates our homework rule. Thread closed. | |
Re: Assuming Turbo C's bin directory is in your PATH and the presence of C:\MyCode containing your source files: [CODE]C:\MyCode>tcc myprog.c[/CODE] | |
Re: [QUOTE]what is a not flat text file?[/QUOTE] CSV is an example of a flat file. XML is an example of a non-flat file. | |
Re: [code] char ch; cin.get( ch ); //or ch = cin.get( ); [/code] Close. The zero argument version of get returns int_type so that it can signal end-of-file with traits_type::eof(). It's directly equivalent to getchar from <cstdio>, which returns int rather than char to account for the potential unsignedness of the … | |
![]() | Re: The easiest way is to use the time library: [code=cplusplus] #include <ctime> #include <iostream> int main() { std::time_t temp = std::time ( 0 ); std::tm *first = std::localtime ( &temp ); first->tm_year = 2008 - 1900; first->tm_mday = 1; first->tm_mon = 0; if ( std::mktime ( first ) != (std::time_t)-1 … |
Re: detectFaces() looks fine, so I suspect that either by misunderstanding or through a typo you've managed to create something that looks like nested functions. For example: [code] int main(void) { ... void detectFaces(IplImage *img) { ... [/code] Notice how main() isn't properly terminated with a closing brace. This would result … | |
Re: Let's use a more complete example: [code] class Foo { public: typedef int SubType; }; template <class T> class MyClass { typename T::SubType * ptr; }; int main() { MyClass<Foo> obj; } [/code] [ICODE]Foo::SubType[/ICODE] is clearly a type, right? But in a dependent name context C++ will assume that the … | |
Re: [QUOTE=Bladtman242;1730737]I hope I'm posting in the right forum :) I'm primarily concerned with C compilers and sun's JDK, but general info is more than welcome (Documentation for self-education as well). Well, if i wrote a program like [CODE] int i = 5 printf("i is $d", i); [/CODE] Would i=5 be … | |
Re: [QUOTE]But if the function doesn't work, the exit function will end it up and return a code error 10[/QUOTE] That's completely wrong. The call to exit() will never occur because there's an unconditional return immediately prior. [QUOTE]what is the relation between int k and return 0?[/QUOTE] There's no relation. [QUOTE]why … | |
Re: [QUOTE=stevanity;1730575]I wanna know what type of parser is used in the gcc and turbo c++ compilers. whether a top-down or bottom-up parser is used..... ?[/QUOTE] GCC uses a hand written recursive descent parser (ie. it's top-down). I wouldn't be surprised if Turbo C++ worked the same way, though it might … | |
Re: [QUOTE] if i use atof() function the number is rounded off to 1234567890123460... ???[/QUOTE] Can you post a complete test program that shows this round off error? For example, does the following work? [code] #include <stdio.h> #include <stdlib.h> #include <float.h> int main(void) { const char *s = "1234567890123456"; printf("DBL_MAX: %f\n\n", … | |
Re: [QUOTE]1- element of a vector/array can "share" same address with the vector/array it was put into. (Well, I always thought each value has its own address) (reference = 2)[/QUOTE] The address of the array and the address of the first element are the same. This makes sense when you think … | |
Re: [QUOTE]Have you tried blocking all IPs from russia David??[/QUOTE] That was brought up as an option, but I suspect Dani doesn't want to risk losing legitimate members from an IP range in the name of spam defense. [QUOTE]And what do most websites use these days? To my knowledge captcha fields … | |
Re: [QUOTE]How do I do that?[/QUOTE] Well, you need some sort of dictionary to look up the words, then pick a word that starts with the letter when there are more than one. | |
Re: [QUOTE]I would like to know the best beginner book for C++.[/QUOTE] The best book is the one you understand that makes the fewest mistakes. I (and most clueful C++ programmers) recommend [URL="http://www.acceleratedcpp.com/"]Accelerated C++[/URL] as a first book due to quality, but that doesn't mean it will be a good fit … | |
Re: Start by understanding the algorithm, them use your knowledge of C++ to write equivalent code. | |
Re: Just because you don't personally use a language doesn't make it unimportant. /thread | |
![]() | Re: [QUOTE]there is problem , in main[/QUOTE] What is problem? :icon_rolleyes: Do you take your car to the mechanic and say "Something is wrong"? Of course not, because the mechanic will find all kinds of things to fix and charge you a buttload of money for being too stupid to give … ![]() |
Re: [QUOTE]daniweb membership is like a bad virus - once you get you'll never get rid of it[/QUOTE] Step 1) Remove all personal information Step 2) Disable contact options Step 3) Log out Step 4) Enjoy the effect of a deleted account The only hard part is ignoring the temptation to … | |
Re: [QUOTE]i am don't know what median is ? or strdDevition ?[/QUOTE] [URL="http://lmgtfy.com/?q=mean+median+mode+%22standard+deviation%22"]Do you know what Google is?[/URL] | |
Re: You've specified the type of the [I]object[/I], not the type of the [I]literal[/I]. An integer literal without any suffix has the type signed int, which means you can't have a value that exceeds the range of signed int[1]. That's why the suffixes are there, so that you can create a … | |
Re: [QUOTE]Let me know, if you think its not correct.[/QUOTE] It's not correct. Let's ignore that unistd.h isn't a standard header (you don't use anything from it anyway) and go right to the first real error. Boiled down, it looks like this: [code] char *no; cin >> no; int len = … | |
Re: What exactly did you read, and what exactly didn't you understand? Command line parameters are exceedingly simple, which suggests that you didn't try very hard or are over-complicating things. | |
Re: You can open and view source code files with Visual C++, but to build them they must first be part of a project. | |
Re: The easiest way would probably be split and trim: [code] string[] parts = LFname.Split(','); if (parts.Length != 2) { // Handle unexpected input } textbox1.Text = parts[0].Trim(); textbox2.Text = parts[1].Trim(); [/code] | |
Re: [QUOTE]If you understand, you can figure out now why I'm naming the title "nested pointer", right?[/QUOTE] I was pretty confident that I knew why just from reading the title. [QUOTE] I'm thought of this "timeline" of process happen in my code... [CODE] note: see my attachment for better picture of … | |
Re: [QUOTE]As you can see that this code is accessible in turbo C but not in Dev C++[/QUOTE] That's because Dev-C++ is properly disallowing a language constraint violation. The address-of operator may only be used on an lvalue. You can use offsetof() to avoid the very hackish calculations that your awful … | |
Re: [QUOTE]But some companies are partners with microsoft [B](which I think is pathetic)[/B].[/QUOTE] The bold part of your statement (emphasis added by me) suggests that you have a strong bias against Microsoft which is probably coloring your opinion of .NET for web development. If you hadn't called Microsoft partners pathetic then … | |
Re: [QUOTE]I don't know what happened and I'm sure that reason is scanf().[/QUOTE] Then let's start by using scanf() correctly. When your [ICODE]choice[/ICODE] variable is a short int, the correct format specifier is [ICODE]%hd[/ICODE]. Fix that and return if the problem persists. | |
Re: [URL="http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_avl.aspx"]Clicky[/URL]. | |
Re: We're not here to do your homework for you. If you want help, you'll have to make an honest attempt at solving the problem and then ask a specific question. | |
Re: Programming is rooted in mathematics, but modern programming really doesn't require any kind of advanced math except in specialized fields. Logic and problem solving are the keys to success in programming. | |
Re: [QUOTE]what am I doing wrong ?[/QUOTE] You're using feof() as the loop condition. feof() won't return true until after a request for input from the file fails, but by then it's too late and you'll continue processing the result of failed input. Given that fgetcsv() returns false on end-of-file, you … |
The End.