377 Posted Topics
Re: See This...... Just Stare at the dot and move forward and backward | |
Re: How about winamp's SDK...check this out [url]http://www.winamp.com/nsdn/winamp/sdk/[/url] | |
Re: [QUOTE=Balachandran]hi guys, i am a beginner and i need a few books which are really good and have lots of exercises.it would be better if it was fully devoted to exercises like 'Exploring C' by Yashavant Kanetkar which was excellent.All his C books are fantastic. you can finnd them at … | |
Re: [quote]Looking at this, I keep thinking with any class you implement using protected data, and when you create a base class (or any other class for that matter, you also create member functions within them. So I can't really make sense of what it's asking... Then it says below the … | |
Re: [QUOTE=atrusmre]How to I remove a varible from memory? A friend and I were talking and he seems to think that just resetting it to "" would be enough. Is he correct? If not, how do I remove varibles when I'm done with them?[/QUOTE] That is not the right way..... We … | |
Re: [QUOTE=nabil1983]thats exactly it whenever i compile it , it keeps giving errors.[/QUOTE] If its only compilation problem then its compiling fine on both DEV C++ and VC++ 6.0.....What compiler are you using??....didn't read your code(maybee there are some logical errors but no compilation error) | |
Re: [QUOTE=! !][color=royalblue] [/color] [url="http://www.codase.com/"][color=royalblue]http://www.codase.com/[/color][/url] [url="http://www.codase.com/about.html"][color=royalblue]http://www.codase.com/about.html[/color][/url][/QUOTE] Nice Link | |
Re: You can take a look at this thread [url]http://www.daniweb.com/techtalkforums/showthread.php?t=31838&highlight=sizeof[/url] | |
Re: You don't need to start two threads for same problem and this is not the right forum for posting such problem | |
Re: Whenever you enter a negative number your counter increases by 1 which i think you do not want.....rest is fine.....Modify the code like this.... [code] if (number1 < 0) { cout<<"One number is invalid. Enter positive number: \n"<<number1<<"\n"; counter=counter-1; }[/code] | |
[code] #include <iostream> using namespace std; class emp { private : int i ; int j; public : emp( ) { i = 10 ; j = 50 ; } void display() { cout<<endl<<i<<" "<<j<<endl; } } ; int main( ) { emp *p = new emp ; p->display(); int … | |
Re: Just do this [code] A(int m) { a=m; b=m; cout<<"\n values are"<<a<<endl<<b; }[/code] | |
Hi guys....i want to access MSAccess using C++....don't know how to.......suggest me some ways to do that | |
Re: [QUOTE=aripaka]Hi, I want to know what is the logic used for generating a random number. Can anyone tell me the algorithm for random number generation without using standard library functions? Thanks[/QUOTE] This forum has a nice tutorial on random numbers...here's the link [url]http://www.daniweb.com/tutorials/tutorial1769.html[/url] | |
Code 1 [code] class Drink { public: Drink( char *name_ ) : name( name_ ) {} char *name; char get(int i) const { return name[i]; } }; [/code] Code 2 [code] class Drink { public: Drink( char *name_ ) : name( name_ ) {} char *name; char & get(int i) … | |
Re: comma ' , ' operator has left to right associativity [code] # include<stdio.h> void main() { int p; p = 1,2; printf("%d",p); } [/code] In this case output will be 1 But if we apply ( ) then last value is assigned to p and output will be 2 | |
Re: [code] #include <iostream> #include <limits> using namespace std; int main() { // Your code here system("pause"); }[/code] | |
Is it right to say that....since arrays are passed by address automatically...so there's no need and reason to return arrays from functions(Is that the reason why it is not allowed in c/c++) | |
Re: In your for loops change [code]i=i++ to i++[/code] code will work fine | |
When a structure is assigned, passed, or returned, the copying is done monolithically....what does this monolithic mean any example?? | |
Re: [QUOTE=ankitrastogi82]As null pointer points to nothing. So, How does the following code works #include <stdio.h> class cb { public: void HelloB() { printf("Calling cb\n"); };//This semicolon should not be here... }; int main(void) { cb* pb = 0; pb->HelloB(); // should it crash here ? return 0; }[/QUOTE] Whereas crashing … | |
[code] #include <iostream> int main(int argc, char *argv[]) { int count=0; if (argc<2) { std::cout<<"Wrong No Of Parameters"; exit(1); } FILE *file; file=fopen(argv[1],"r"); char c; while((c=getc(file))!=EOF) { if (c=='\n') { count+=1; std::cout<<std::endl; } else printf("%c",c); } std::cout<<"\nNo Of Lines In the File :"<<count+1; fclose(file); return 0; } [/code] My program … | |
| |
Why in C++ passing a pointer is not termed as a parameter passing technique.....Is it because it has a flaw of some kind i.e. address is not reflected back/we can change the address in called function..is that so...if that's the reason....then we can pass it as const pointer as a … | |
can anyone tell me about send keys.....if possible attach a small code also | |
We cannot have static friend function...is it because 1.since static member functions can access only static data members...whereas friend function can access all the members. 2.friend function also require an object to access the members...wheeras static member functions can not. 3.One more thing....since friend functions are non-member functions....and static functions … | |
why does everyone gets so heated up..when it comes to turbo C++ compiler...can someone give me reasons | |
[code] #include <stdlib.h> #include <stdio.h> #define SIZE 15 int main() { int *a, i; a = (int*) malloc(SIZE*sizeof(int)); for (i=0; i<SIZE; i++) *(a + i) = i * i; for (i=0; i<SIZE; i++) printf("%d\n", *a++); free(a); return 0; } [/code] Why Is My Program Crashing?? | |
I wanna know how to host wiki pages say on geocities or some place else.. | |
Can we find the smallest of three integers, without using any of the comparison operators....logic please | |
[QUOTE=narue]Well, you didn't specify how it didn't work, but on one of my compilers, there's a run-time assertion if the allocation size exceeds a certain limit, and 4294967295 is beyond that limit. Such an assertion throws up a dialog box and aborts the program, which could look like an uncaught … | |
sizeof (int) gives me 4 bytes...is it sufficient to say that my machine is of type 32-bit | |
as new throws exception bad_alloc...does malloc also throws exception of some kind??? | |
| |
Plz look at this code [code]#include<iostream.h> int x=0; int main() { int x=1; { int x=2; cout<<::x; cout<<x; } return 0; }[/code]<< moderator edit: added [url=http://www.daniweb.com/techtalkforums/misc.php?do=bbcode#code][co[u][/u]de][/co[u][/u]de][/url] tags >> does anybody know how can i access main local variable x, from inside the block, without using pointers or references? | |
Plz See [code] #include<stdio.h> #define TOTAL_ELEMENTS (sizeof(array) / sizeof(array[0])) int array[] = {23,34,12,17,204,99,16}; int main() { if(-1<= (TOTAL_ELEMENTS-2) ) printf("%s","gotcha\n"); else printf("%s","oops\n"); return 0; } [/code] why is it printing oops | |
From where can i find the header file unistd.h...one of my program requires it | |
Re: [code] A(j); [/code] How is that we are calling the constructor explicitly...i thought it was not possible | |
Re: [QUOTE=Niklas]When I run the program It says "Please enter the 2 numbers that will be added" but when I try to enter a number and press enter it doesnt do anything it just keeps skipping lines. Why is it not working. I declared the variables. Asked the user to enter … | |
Re: You need to allocate one more space for null character..... and after for loop add this line [code] encryption[45]='\0''; [/code] | |
This question was asked to me..plz see [code] #include<stdio.h> void change() { /*Write something in this function so that the output of printf in main function should give 5 . Do not change the main function */ } void main() { int i=5; change(); i=10; printf("%d",i); }[/code] and i answered … | |
[code] char *name; cout<<name; [/code] and [code] char*name; name=new char[20]; cout<<name;[/code] both of these work....then why do i need memory allocation....where does the first code fails | |
Re: [QUOTE=Ancient Dragon]yes. [code] char * foo() { static char array[] = "Hello World"; return array; } int* foo1() { static int array[20]; return array; } [/code][/QUOTE] You should see this link [URL=http://www.daniweb.com/techtalkforums/thread5939.html]POST[/URL] | |
Basically what i want to do is....whenever i drag the form...i should be able to see the current top and left coordinates...i know there is a resize event but it does not updates top and left...it only updates height and width.... is there any way to simulate reposition event | |
Re: Diffrence between word and notepad...i guess u r at wrong forum for ur other question..... use srand(time(0)) function...it will give u random number as a seed to rand() function | |
can anyone give me an example of dynamic type checking...how do we do tht |
The End.