506 Posted Topics

Member Avatar for ejptccs123

preprocessor directives/macros are processed at the time of compilation. Arguments relevant to preprocessor (e.g. -DXXX=value) are passed to compiler and used by compiler. Any argument passed on command line is called command line arguments. :). So these are the CLI args to compiler. After compilation (and linking) the executable of …

Member Avatar for thekashyap
0
171
Member Avatar for gattispilot

Consider following the coding practice: When you compare a const with a non-const for equality put const on LHS instead of RHS. E.g. [code=c]//instead of this: if ( start == 0 ) //do this: if ( 0 == start )[/code]

Member Avatar for gattispilot
0
198
Member Avatar for vinod_javas

Check out [URL="http://www.daniweb.com/forums/showthread.php?t=72703"]this thread[/URL], it also has some links to more info...

Member Avatar for thekashyap
0
156
Member Avatar for Firestone

Problem is you're copying old to new, whereas what you want to do is new to old. Also using wrong formatting in printf(). See the comments inside the code: [code=c] #include <stdio.h> #include <stdlib.h> #include <string.h> //to avoid hard coding. #define MY_MSG_LEN 100 int main(void) { char oldMsg[MY_MSG_LEN], newMsg[MY_MSG_LEN]; int …

Member Avatar for Firestone
0
153
Member Avatar for tracethepath
Member Avatar for WaltP
0
162
Member Avatar for no1zson
Member Avatar for go939

Must be something to do with the way you're using them.. parameters etc.. see which object file or .so or .a file contains teh required symbols and add that on link cmd..

Member Avatar for Salem
0
149
Member Avatar for praneeth_gunda
Re: Crc

[quote=praneeth_gunda;398354]Am Giving u The Code Mr.Naure[/quote] Sorry couldn't help comment off topic.. It's Ms. Naure not Mr. :D See the avatar?

Member Avatar for Aia
0
273
Member Avatar for pixrix

Depends on what your friend means.. does he mean use C++ language features to solve the problem that is solved using C.. Or does he mean just make this code compile using a C++ compiler.. ?

Member Avatar for ~s.o.s~
0
297
Member Avatar for new_2_java

See [URL="http://www.daniweb.com/forums/showthread.php?t=73182&highlight=Runtime"]this thread[/URL].. it should answer all your questions and give you enough examples..

Member Avatar for new_2_java
0
552
Member Avatar for endsamsara

[quote=endsamsara;397902]Hi, How do i create a class called Text that creates an object from a string and that deletes the first word of the text have no idea I was starting like [code] public class Text{ public static void main(String[] args) { String str = "this is a little text …

Member Avatar for Ezzaral
0
109
Member Avatar for jethfo
Member Avatar for AHbrendan
0
116
Member Avatar for quintoncoert

>> Can one get the system function to let the called program write its output to a >> variable instead of writting it in the command window? Yes. But AFAIK it would be useless because that variable would be part of the shell (assuming you're on Unix) that executes teh …

Member Avatar for Ancient Dragon
0
168
Member Avatar for Hamrick

>> Is a base and derived class overkill for a sorting function? Yes (because for all practical purpose you would want your sort function to have bare minimum overhead, e.g. virtual call in this case). But not if you're trying to learn templates, inheritance and function objects >> How cand …

Member Avatar for thekashyap
0
150
Member Avatar for ridhimasatam

Or of course you can pass it by C++ reference like: void foo( char *& ptr) { ptr = new char[255]; } int mian() { char *ptr = 0; foo( ptr ); <snip> return 0; }

Member Avatar for ~s.o.s~
0
350
Member Avatar for arunprashanth

Some more info like OS, Java version, kind of application would help. I don't really know anything specific in Tomcat itself though. :). You can do things like nice in Unix.

Member Avatar for reflex2java
0
67
Member Avatar for pixrix
Member Avatar for lilneppy

[URL="http://www.daniweb.com/forums/thread70096.html"]This thread[/URL] is meant for such questions.

Member Avatar for thekashyap
0
91
Member Avatar for vladdy19

A pointer pointing to base class can be converted to a pointer pointing to derived class (down-casting) if the original pointer is actually pointing to a derived class type. To enforce this is the work of dynamic_cast operator. Consider following example. [code=cpp]#include <iostream> using namespace std; class base { public: …

Member Avatar for ~s.o.s~
0
172
Member Avatar for arunprashanth
Re: Java

AFAIK: A web-server usually hosts only front-end jsps/htmls. It will have very little or no business logic. An Application server on the other hand would host a lot more of business logic.

Member Avatar for masijade
0
114
Member Avatar for vicky_dev

Interesting.. 1. I didn't know that -lXYZ could be interpreted by linker as libXYZ.[COLOR=red][B]a[/B][/COLOR] as well. (thought it's always seen as libXYZ.[COLOR=red][B]so[/B][/COLOR]). I checked gcc manuals (gcc 4.2.0) and seems fine. 2. Only reasons I can think of why this could be happening is: A) There are object and library …

Member Avatar for vicky_dev
0
118
Member Avatar for SHWOO

1. Inside copyStack() this line.. [inlinecode]current = otherStack.stackTop;[/inlinecode] ..would ensure a crash as it would make current point to NULL. 2. Usually it's better to re-use the code. So in this case you can implement the copy like this: [code=c] void linkedStack::copyStack(linkedStack& otherStack) { node* currNode = stackTop ; int* …

Member Avatar for SHWOO
0
166
Member Avatar for ZachH26

Read-up the basics of arrays, function, function parameters.. then write a program and ask for help..

Member Avatar for ZachH26
0
379
Member Avatar for quintoncoert

[quote=quintoncoert;394188]Thirdly. Can anyone suggest some good books on MFC?[/quote] If you donno anything this is usually a good starting point. :) [URL="http://www.amazon.com/Visual-C-Dummies-Michael-Hyman/dp/0764503723"]Visual C++ 6 for Dummies[/URL] Although I personally prefer "the internet" to learn basics and books for more in-depth stuff..

Member Avatar for Narue
0
197
Member Avatar for phalaris_trip

[B]Line 15: [/B]Reading from cin, read from "file". [B] Line 18: [/B]This would always set charsPerLine to 0. (12/100) would evaluate to 0. Make it (12.0/100.0) [B] Line 23-24: [/B]Not clear what are you trying to do. Remember getline() remove teh '\n' char. So you won't find that in captionText. …

Member Avatar for phalaris_trip
0
96
Member Avatar for prinz_watta16

[quote=happygeek;394707]Sounds awfully like someone expecting the DaniWeb membership to do their homework assignment for them, without any effort of their own, to me...[/quote] I++

Member Avatar for thekashyap
0
76
Member Avatar for Jaav

1. The reason why you're getting some junk for last line is because you have given 6 %d(s) inside the format string and supplied only 5 values. 2. Execute the following code and you should see some difference. May be that should point you in right direction. Here are the …

Member Avatar for thekashyap
0
143
Member Avatar for ridhimasatam

>> for some reasons i hav #included B.h in A.h hence #include A.h in B.h is giving error. This should never be done. In any case include guard as Naure described should solve the problem. But I suggest you relook at your dependencies and see how to avoid one of …

Member Avatar for thekashyap
0
62
Member Avatar for ridhimasatam

Usually you are supposed to have 2 files per class. Header file: ClassName.h, which declares the class interface. Source file: ClassName.cxx/cpp/.. which defines the class. I.e. has implementation for the class's interface. Assuming you have A.h and A.cpp, to use A's variables in another class B, you'll have to #include …

Member Avatar for thekashyap
0
68
Member Avatar for bvgsrs

Use MS Visual C++ (get Visual Studio).. you can find lotsa online tutorials for that..

Member Avatar for bvgsrs
0
2K
Member Avatar for ndeniche

Am on level 6.. :) took about 10 minutes to get there after the KlueLess experience..

Member Avatar for ndeniche
0
195
Member Avatar for tolearn

Looks like local_jlist is a function local variable (inpublic Prod_applet()).. and not in the scope where you're using it (line 226).. make it a member variable.. it should work..

Member Avatar for pjade
0
178
Member Avatar for mayank_03_arora
Member Avatar for kinggarden
Member Avatar for amitmistry_petl

A dll is not a process.. :) May be the following will help: - Once you've written your C/C++ code, you will compile it and then link it. Once you do this you will have an executable file (.exe on windows) - Your code usually be using some or the …

Member Avatar for ThomsonGB
0
197
Member Avatar for reedla

[quote=reedla;392326]Am I close at all??[/quote] May be about 10% of your work is done.

Member Avatar for quintoncoert
0
111
Member Avatar for aasi007onfire

In simplest terms: Compiler looks at a 2D array as a 1D array that has a 1D array as elements.

Member Avatar for thekashyap
0
96
Member Avatar for nalinibh

[quote=Salem;391508]Even the most optimistic precision (not accuracy) figures for clock() are at least 1M times slower than the clock frequency of most modern desktop machines.[/quote]Not that it stops you from using clock(). All you gotta do is just put the code in a loop and run it a few 100/1000 …

Member Avatar for thekashyap
0
454
Member Avatar for 4zlimit

I just did a Ctrl+F in this thread for following 3 functions: cannot find symbol method setItemNumber(java.lang.String) cannot find symbol method setProductName(java.lang.String) cannot find symbol method setNumOfUnitsInStock(int) I didn't see their definition.. That should be the problem.

Member Avatar for thekashyap
0
186
Member Avatar for tito_mbo
Member Avatar for Ortal

1. Write some comments in the code. 2. Nice of you to use code tags, did you know that you can also add the language name to it for syntax highlighting. 3. Problem might be that next is not initialized to NULL. So on line 110 after first iteration current …

Member Avatar for thekashyap
0
149
Member Avatar for Covinus

I don't know of any C/C++ function that waits for user input for a finite/specified time. Which means you'll have to use multi-threading for sure. See [URL="http://www.daniweb.com/forums/showthread.php?t=71946&highlight=thread+input"]this thread[/URL] if it helps.

Member Avatar for Salem
0
112
Member Avatar for aasi007onfire

[quote=aasi007onfire;391062]if they r the same then why 2 names r being used..[/quote] Surprised that no one mentioned that they are NOT the same and that's the reason 2 different names are used. As Aia said only rule (according to standards) is [COLOR=Green]sizeof( short ) ≤ sizeof( int ) ≤ sizeof( …

Member Avatar for ~s.o.s~
0
110
Member Avatar for Thinka

First I assume your question is how to find out the performance/time of your function. In this case I really donno how you can use Sleep ?! As I use timing quite frequently I have the following code (similar to Vijyan's) I use to make it easy to use. [code=cplusplus] …

Member Avatar for Narue
0
1K
Member Avatar for JRM

>> size_t n = vint.size(); >> int arr[n]; This is not supposed to work ! [quote=JRM;389991] I tried to do direct assignment: arr=vint // why won't this work? essentially they're both arrays- or so i thought.[/quote] I donno what you mean by won't work. But this thing in particular is …

Member Avatar for Narue
0
235
Member Avatar for bops

If you don't wanna be platform dependent you can still do this by forking a thread for system(). Should be simple enough as well. [code=c]pid = fork() ; if( 0 == pid ) system("...") ; //your normal code here.. [/code]

Member Avatar for thekashyap
0
2K
Member Avatar for shanthu123

There shouldn't be a "major" difference due to compilers, it's more to do with the platform (OS+H/W) then compiler. Using same compiler you can use different optimization levels, this should make a visible difference in performance.

Member Avatar for thekashyap
0
165
Member Avatar for math_man

In Visual Studio 6, by default it creates 2 configurations "Win32 - Debug" and "Win32 - Release". The way to go to debug build is somewhere you have an option (think in Project menu) to "Set active configuration". There ensure that you've selected "Win32 - Debug". One way to know …

Member Avatar for thekashyap
0
139
Member Avatar for bala24

[quote=bala24;390761]Hi guys and Gals, Have some trouble digesting some facts about Casting in C++. 1). Why can't we use a static_cast for safe downcasting on a polymorphic class? 2).Consider this snippet.. [code=cplusplus] class A {}; class B { public: B (A a) {} }; A a; B b=a; [/code] [COLOR=green]How …

Member Avatar for thekashyap
0
117
Member Avatar for laugh

1. Don't use goto, language provides so many other better/safer/understandable ways. 2. Seems like PORTAbits.RAXX is an int/short instead of a boolean. I would suggest: A) Trace out their values. B) See how to check such flags. I remember there was some thread where I described how bitwise operations are …

Member Avatar for Salem
0
104

The End.