6,741 Posted Topics

Member Avatar for stereomatching

[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 …

Member Avatar for stereomatching
0
142
Member Avatar for simplypixie

[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 …

Member Avatar for Narue
0
201
Member Avatar for YAMNA MIDHAT

[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() …

Member Avatar for WaltP
0
189
Member Avatar for gourav1

[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.

Member Avatar for gourav1
0
275
Member Avatar for Dharshika
Member Avatar for Ararat

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, …

Member Avatar for Ararat
0
311
Member Avatar for PrimePackster

[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:

Member Avatar for PrimePackster
0
327
Member Avatar for capton

[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() { …

Member Avatar for AceStryker
0
2K
Member Avatar for naraayanan

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.

Member Avatar for Narue
0
172
Member Avatar for Knoxarama

[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 …

Member Avatar for Narue
0
294
Member Avatar for pseudorandom21

[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 …

Member Avatar for Rashakil Fol
0
213
Member Avatar for deluksic

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.

Member Avatar for deluksic
-1
2K
Member Avatar for PrimePackster

[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 …

Member Avatar for Narue
0
207
Member Avatar for Ararat

[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 …

Member Avatar for DJSAN10
0
8K
Member Avatar for sasho648

[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] …

Member Avatar for LRRR
0
160
Member Avatar for The 42nd

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 = …

Member Avatar for Narue
0
2K
Member Avatar for sameerge

OP clearly has no intention of doing any work, which means this violates our homework rule. Thread closed.

Member Avatar for Narue
0
1K
Member Avatar for Haritha91

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]

Member Avatar for Narue
0
118
Member Avatar for stakeMyHeart

[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.

Member Avatar for stakeMyHeart
0
4K
Member Avatar for Run.[it]

[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 …

Member Avatar for Narue
0
3K
Member Avatar for DigitalPackrat

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 …

Member Avatar for bbman
0
901
Member Avatar for yinyue

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 …

Member Avatar for Narue
0
209
Member Avatar for myk45

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 …

Member Avatar for myk45
0
100
Member Avatar for Bladtman242

[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 …

Member Avatar for Bladtman242
0
156
Member Avatar for anita_86

[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 …

Member Avatar for anita_86
0
160
Member Avatar for stevanity

[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 …

Member Avatar for stevanity
0
871
Member Avatar for agniputra

[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", …

Member Avatar for dannyniu
0
755
Member Avatar for Vasthor

[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 …

Member Avatar for Narue
0
223
Member Avatar for happygeek

[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 …

Member Avatar for Dani
2
1K
Member Avatar for Xinen

[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.

Member Avatar for Adak
0
137
Member Avatar for lastbencher

[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 …

Member Avatar for lastbencher
0
227
Member Avatar for nicprog

Start by understanding the algorithm, them use your knowledge of C++ to write equivalent code.

Member Avatar for nicprog
0
100
Member Avatar for kartik bodala
Member Avatar for Webmastergrace
0
181
Member Avatar for HASHMI007

[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 …

Member Avatar for HASHMI007
0
136
Member Avatar for steven woodman

[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 …

Member Avatar for Rick Hern
0
304
Member Avatar for programing

[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]

Member Avatar for adityatandon
0
119
Member Avatar for DJSAN10

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 …

Member Avatar for DJSAN10
0
158
Member Avatar for kankaortiz

[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 = …

Member Avatar for adityatandon
0
5K
Member Avatar for Srinivas0

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.

Member Avatar for Srinivas0
0
189
Member Avatar for ila_asia
Member Avatar for fmasroor

You can open and view source code files with Visual C++, but to build them they must first be part of a project.

Member Avatar for NP-complete
0
101
Member Avatar for auwi987

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]

Member Avatar for auwi987
0
101
Member Avatar for Vasthor

[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 …

Member Avatar for Narue
0
2K
Member Avatar for 3435

[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 …

Member Avatar for Trentacle
0
184
Member Avatar for pro_learner

[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 …

Member Avatar for MooGeek
0
196
Member Avatar for fka

[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.

Member Avatar for fka
0
292
Member Avatar for swagen

[URL="http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_avl.aspx"]Clicky[/URL].

Member Avatar for Narue
0
64
Member Avatar for mohan_198505

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.

Member Avatar for dij_0983
0
506
Member Avatar for MooGeek

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.

Member Avatar for vegaseat
0
162
Member Avatar for peter20

[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 …

Member Avatar for fobos
0
911

The End.