6,741 Posted Topics

Member Avatar for tadisaus2

[QUOTE=mazhar1986;1693162]lots of contradictory replies, which one's right?[/QUOTE] Please notify the Oxford English dictionary. "Lots" has been redefined to mean "two". :icon_rolleyes: But given cscgal's track record with this site, I'd lean toward her opinion of having great content and letting the backlinks handle themselves...even if it [I]didn't[/I] seem otherwise obvious.

Member Avatar for Harley145
0
193
Member Avatar for djextazy

>It works fine as for(i=1;i<=n;i++) . Yes it does. But then again, so does this: [code] i = 9; loopie: // Do stuff if ( --i > 9 - n ) goto loopie; [/code] Most programmers prefer to use the idiomatic approach because it's easier to use, easier to get …

Member Avatar for hust921
0
208
Member Avatar for ahspats

>void StringSearch(char String[], char Ch, char *Ptr); The first rule of simulating pass-by-reference using pointers is that if you want to change the value of an object, you pass a pointer to it. You want to change the value of the pointer, not the character being pointed to, so you …

Member Avatar for yasin.uohyd
0
215
Member Avatar for Zay

There are several ways. Not to mention that graph algorithms tend not to be trivial, so you'd be better off studying existing solutions, like Prim or Kruskal's algorithms.

Member Avatar for Dmitry74
0
186
Member Avatar for SubProf

Reverse your order of opening. Open the main form (but don't show it). Then from the main form's load event open the login form. If the login is valid, show the main form and close the login form. If the login is invalid, do an Application.Exit() or close the main …

Member Avatar for EmporerHaki
0
190
Member Avatar for sinrtb

Faster how? Compiles faster? Links faster? Generates faster machine code? You have to be more specific, and even then you'll probably get a bunch of people spouting benchmark nonsense. The best way to find out which compiler suits your needs is to test them all on the system in which …

Member Avatar for Jimmeny
0
435
Member Avatar for scru

>Just interested in the different methods everyone >uses to plan their projects, set timelines, etc. What is this planning thing you speak of? Just kidding, I use a variation of Scrum that's optimized for small teams.

Member Avatar for stultuske
0
116
Member Avatar for varunrathi

>is there any way by which i can store more no. of digits. Are you using C or C++? If C++ then an array should be avoided in favor of a standard container that grows dynamically, such as std::vector. If C then you need to simulate your own dynamic array …

Member Avatar for gerard4143
0
1K
Member Avatar for D19ERY

There are two steps. First, use the uint type. Second, validate the input string against the uint type before saving it: [CODE] uint value; Console.Write("Enter a positive integer: "); while (!uint.TryParse(Console.ReadLine(), out value)) Console.Write("Invalid input. Enter a positive integer: "); numbers[I] = value; [/CODE]

Member Avatar for skatamatic
0
143
Member Avatar for davidTechy
Member Avatar for Wiki_Tiki

>I can't find any way around it because System::string >has no stringstream, or any ostringstream. You probably don't need a string stream. System::string is a surprisingly robust class that can probably handle what you want to do in a slightly different way. Perhaps if you described the problem you want …

Member Avatar for RhondaCos
0
2K
Member Avatar for yvliew

>Any instructions on the web? I cannot find any. I could. Strangely enough, they were on the Toshiba support web site. :rolleyes: Rule 1) If it's not easily accessible and you aren't well versed in how to do it, don't screw around. Toshiba recommends that you send in the computer …

Member Avatar for caperjack
0
841
Member Avatar for Joniniko

[QUOTE]So lets say you are given 10 seconds to answer the question and every correct answer adds you 10 seconds. How would i implement this?[/QUOTE] The simplest approach would have you checking the difference of the time between the point where the question is displayed and the point where the …

Member Avatar for JilMakias
0
453
Member Avatar for cwarn23
Member Avatar for pseudorandom21
0
396
Member Avatar for vtskillz

>I have a variable: >char *insert = "abcdefgh" >and i want to split that into chars like so, 'a', 'b', 'c', 'd', etc. Uh, you're done. A string literal is an array of const char and except for modification, sizeof, and address-of you can use the pointer as if it …

Member Avatar for arunsolo1984
0
5K
Member Avatar for Eclipse

>I got the method down here (for the first integer): Why not write it generally for all integers? [code] public int reverse_integer ( int val ) { int ret = 0; while ( val != 0 ) { ret = 10 * ret + ( val % 10 ); val …

Member Avatar for JamesCherrill
0
265
Member Avatar for vissure

This is a common test question. Have you tried to solve it yourself? Here's a hint: you can move data as well as change links.

Member Avatar for Sandeep Shetty
0
276
Member Avatar for Aniqa Shaikh

[QUOTE=Aniqa Shaikh;1092365] Atleast u'll not have to waste time like i did!!!! [/QUOTE] How can it be a waste of time when you learn how to do something? You're basically just preemptively doing everyone's homework for them with this code snippet (seeing as how this program was homework, judging by …

Member Avatar for sameershah21
1
670
Member Avatar for king03

The question is binary in the majority of cases: you either have a degree or you don't. Your GPA and grades in the process of obtaining a degree are largely irrelevant after graduation.

Member Avatar for stultuske
0
200
Member Avatar for zerohero

You should search the forum before asking a question that's been [thread=11968]asked before[/thread].

Member Avatar for Kalel Kristoff
0
834
Member Avatar for daviddoria

Given that at least Ideone has an API, that's not an unreasonable suggestion. Though many (if not most) code blocks on Daniweb are not meant to be compilable as-is, so the best fit for such a feature would be in our code snippets rather than discussion threads.

Member Avatar for JackieBolinsky
0
218
Member Avatar for KazenoZ

Why don't you post the code you've tried that doesn't work? We can show you where the problem is.

Member Avatar for Shimano
0
1K
Member Avatar for XO39

[QUOTE]Can anyone explain -in simple words as possible- what happens in the first code so that it prints the result that way?[/QUOTE] [URL="http://en.wikipedia.org/wiki/Undefined_behavior"]Undefined behavior[/URL].

Member Avatar for XO39
0
179
Member Avatar for gourav1

graphics.h is certainly a problem, why do you use a graphics library from two decades ago?

Member Avatar for DeanMSands3
0
181
Member Avatar for radc

[QUOTE]I just want to hear from members who has experience in industry as well as students of the forum what do you think about this?[/QUOTE] What do we think about [i]what[/i] exactly? It comes as no surprise that the application side is growing more quickly than the systems side, and …

Member Avatar for Dexxta27
0
192
Member Avatar for CurlyFried

[CODE]#include <cstdlib> // I'm needed for rand() and srand() #include <ctime> // I'm needed for time() #include <iostream> int main() { // Put me at the start of the program srand((unsigned)time(0)); const int N = 100; // Watch as random numbers between 0 and N are generated for (int i …

Member Avatar for WaltP
0
205
Member Avatar for aeiou2001

[QUOTE]my friend need it for him to land a job..[/QUOTE] If your "friend" can't answer the question without help, he [I]shouldn't[/I] get the job. Also note that confusing both parentheses and braces for angle brackets is a sure way to not get hired for any job that requires even the …

Member Avatar for Narue
-3
134
Member Avatar for PrimePackster

[QUOTE]Yes, i want the space to be inserted when you press enter, without jumping to the next line. And when the maximum number of columns in a row is reached, it should jump on to the next line ie. the new row....[/QUOTE] Assuming you want the console to auto-format itself …

Member Avatar for PrimePackster
0
258
Member Avatar for nijinjose123

Please provide some new information to justify a second thread on the topic.

Member Avatar for raptr_dflo
0
1K
Member Avatar for see_moonlight

>extern char* delete_space_from_string ( char *string /* I */ ) extern is redundant. All function declarations are extern in C by default. >if ( string == NULL || *string == NULL ) NULL should only be used in pointer context: [code] if ( string == NULL || *string == '\0' …

Member Avatar for isaacws
0
575
Member Avatar for Bladtman242

[QUOTE]Obviously I have some wrong assumptions, because this prints "strsize = 8" no matter what.[/QUOTE] Good call. buff is a pointer to char, so sizeof(buff) will always tell you what the size of a pointer to char is, not the length of the string it points to (if it points …

Member Avatar for Bladtman242
0
180
Member Avatar for FierstArter

[QUOTE][CODE]pStu= new (nothrow) student pStu[i];[/CODE][/QUOTE] Should be this: [code] pStu= new (nothrow) student[i]; [/code] You also need to include <cstdlib> because that's where system() is declared.

Member Avatar for FierstArter
0
268
Member Avatar for behemothdave

[QUOTE]Only one problem, what is a masked text box?[/QUOTE] Here's a hint for the future: always try to research things like this on your own first. The only if you come up with nothing or fail to understand what you've found should you ask for clarification. In this case, "masked …

Member Avatar for behemothdave
0
199
Member Avatar for PrimePackster

[QUOTE]Wow! I never knew it was a C function. Thanks for sharing that, now onward i will not use that.[/QUOTE] The fact that it's a function inherited from C is largely irrelevant. The important piece of information is that gets() is quite literally impossible to use safely. There's always a …

Member Avatar for PrimePackster
0
184
Member Avatar for siabenie

[QUOTE]Can anyone explain to me in details preferable with an example the different between i++ and i++ please.[/QUOTE] The standalone difference is as functionally as follows: [code] // A function that performs ++i int prefix_increment(int& i) { i = i + 1; return i; } // A function that performs …

Member Avatar for siabenie
0
171
Member Avatar for gpta_varun

>Is there any way , memory leaks can be clogged in c/c++ ... Knowledge and discipline. If you're aware of how memory leaks can come about in your project and apply a disciplined approach to avoid them, that's all you need. >Are there any good tutorials on how can we …

Member Avatar for MastAvalons
0
206
Member Avatar for theCompiler
Member Avatar for WaltP
0
133
Member Avatar for ahp@aol.in

[QUOTE]If it is because of undefined behavior then how every time answer is coming as 7 6 7.[/QUOTE] Undefined is not synonymous with inconsistent. On the same compiler, undefined results could very well be the same for every run. But there's no guarantee of that, or that other compilers or …

Member Avatar for jumbowat
0
804
Member Avatar for mrprassad

[QUOTE][CODE]*p ^= *q ^= *p ^= *q;[/CODE][/QUOTE] This statement invokes undefined behavior by modifying an object multiple times between sequence points. While cute, the correct form of an XOR swap is as follows: [code] *p ^= *q; *q ^= *p; *p ^= *q; [/code] Notice how it's broken down into …

Member Avatar for Narue
0
155
Member Avatar for phorce

Your compiler should support some form of getcwd(), check the documentation.

Member Avatar for Narue
0
12K
Member Avatar for prakhar_cool

[QUOTE]Isn't it should be pointing the address of variable p?[/QUOTE] You can't expect a pointer to member to be printable at all, actually. The term "address" is used to mean "reference to a location", which for practical reasons compilers have implemented as a physical or virtual memory address. However, that's …

Member Avatar for rubberman
0
271
Member Avatar for jaclynkinsey
Member Avatar for PrimePackster

At most this would be a popularity contest, and I think that's what the OP intended. [QUOTE]Maybe you people can show some statistics in a regular basis[/QUOTE] Statistics don't say much. Going by numbers, the mod who formats and adds code tags to 100 posts had a greater impact than …

Member Avatar for PrimePackster
0
261
Member Avatar for Zssffssz

[QUOTE]If my program doesnt use the stack or heap at all (as in me putting a new or stk()? in it) will it still have (however small) memory leaks?[/QUOTE] If you don't create leaks, or use any libraries that create leaks, then it stands to reason that there won't be …

Member Avatar for MastAvalons
0
139
Member Avatar for Karlwakim

[QUOTE]in the end of each program, i get the message "Process returned 0 (0x0). execution time : ....... press any key to continue" How can i get rid of that.[/QUOTE] Stop running the program from within Code::Blocks. :icon_rolleyes:

Member Avatar for Narue
0
112
Member Avatar for jryans10

If your program uses the .NET framework then obviously that's a dependency required on the target machine.

Member Avatar for stbuchok
0
166
Member Avatar for pseudorandom21

AES isn't especially difficult to implement from the specification. Ignoring the usual caveats of reinventing the wheel on important stuff like encryption, you could write your own class: [code] #ifndef JSW_AES_PROVIDER_H #define JSW_AES_PROVIDER_H #include <vector> namespace jsw { namespace encryption { typedef std::vector<unsigned char> bytes_t; class aes_provider { public: aes_provider(bytes_t …

Member Avatar for Narue
0
237
Member Avatar for jryans10

[QUOTE]Wouldn't it be better if we just defined the functions before the main function instead of having a function prototype and a function definition in separate areas?[/QUOTE] What if you want to break your program up into multiple files? What if you want to write a library that will be …

Member Avatar for jryans10
0
128
Member Avatar for jryans10

[QUOTE]I know that with the pointer you use the "->" operator to access the object methods, and with the other one you use the "." operator, but what exactly is the difference between them?[/QUOTE] In the first declaration, [ICODE]rectangle[/ICODE] is a reference to an address where a Shape object happens …

Member Avatar for Narue
0
146
Member Avatar for MrEARTHSHAcKER

The End.