189 Discussion / Question Topics

Remove Filter
Member Avatar for nitin1

code 1: void fun(const int **); int main() { int **p; fun(p); } code 2: void fun(const int **); int main() { const int **p; fun(p); } code 1 is compile error and 2 is not. can you explain why ? as per my knowledge, we can convert a non-const …

Member Avatar for nitin1
0
158
Member Avatar for nitin1

va_arg (ap,int(*)()) here, ap is the va_list type variable and it is started with va_start() already. the place where i have read this said that this is wrong and you have to typedef it first , then you can extract the pointer to a function from the va_arg(). why is …

Member Avatar for nitin1
0
191
Member Avatar for nitin1

#include<stdio.h> main() { int a=258; int *num=&a; printf("%d %d",*((char *)num),*((char *)num+1)); } does the output depends on little endian or big endian structure of machine on which i am running this ? thanks.

Member Avatar for nitin1
0
148
Member Avatar for nitin1

code 1: #include<stdio.h> int main(void) { int a; a= 1,2,3; int b = a++; printf("%d",b); return 0; } code 2 : #include<stdio.h> int main(void) { int a; a= (1,2,3); int b = a++; printf("%d",b); return 0; } Can you please explain why that bracket is making ouput changed ? i …

Member Avatar for pooh1234qwerty
0
138
Member Avatar for nitin1

Wouldn't it be nice if we have a notification system ? I mean i will get notifications of only those threads on which i have replied at least once or the threads which are started by me ? It is going to help me alot if i have a beep …

Member Avatar for Dani
0
200
Member Avatar for nitin1

i know how numerical values are represented in memory. like +3, -3, 0, 1 , 3321 and like this. can you tell me how float, double are represented in memory ? like 3.220, -9876.87 ? i mean how bits are presented in memory ? like for singed number 32th bit …

Member Avatar for rubberman
0
205
Member Avatar for nitin1

actually, i deleted my one account on daniweb some time back, but i wana look at the posts ,whatever i have asked, comments by experts here and everything. i know i can see the posts, but i have to go very far away from today so as to look each …

Member Avatar for happygeek
0
792
Member Avatar for nitin1

int m= i++ || ++j && k--; where i=2, j=3, amd k=5; acooridng to me, it will be executed left to right and then values of m=1, i=3, j=3 and k=5. but i have seen that precednace of && is more than || , than so how this expression is …

Member Avatar for Banfa
0
311
Member Avatar for nitin1

#include<stdio.h> void f(int n) { char pp[n]; printf("%d\n",sizeof(pp)); } int main() { int n; scanf("%d",&n); f(n); } In this program the size of array is defined at runtime,and sizeof operator is printing correct size after runtime initialisation in gcc 4.4. Can anybody explain? we say that sizeof is compile time …

Member Avatar for sepp2k
0
189
Member Avatar for nitin1

http://www.time4education.com/#login-box this is the link and when i click login box, nothing happens, when i give this to my friiend, then he is able to have a login box opened. please i have to register and please tell how to open this link ? thanks.

Member Avatar for diafol
0
291
Member Avatar for nitin1

a linked list is given, and a only pointer to a node is given which need to be deleted. it is singly linked list. you dnt have accees to any other pointer like head or what. you only have that node pointer in ur hand. thanks.

Member Avatar for deceptikon
-1
139
Member Avatar for nitin1

i have thought a lot on this. but not getting O(n) solution. given n URL's and you have to find the unique URL in that (if there is any). you have to print that URL. thanks. O(n2) solution is a stupid solution, some O(n) is acheivable, but not getting how …

Member Avatar for deceptikon
0
128
Member Avatar for nitin1

although, i have read C++ books in my past, but as my placement session is there, i just want to have some books from where i can see everything in shortest and concise possible. classes, polymorphism, inheritnce concepts etc like this . any book which u can tell me ? …

Member Avatar for dexblack_1
0
186
Member Avatar for nitin1

int a[]={1,3,4,5,7}; int b[]={2,3,5,6}; int m=sizeof(a)/sizeof(int); int n=sizeof(b)/sizeof(int); cout<<m<<" "<<n<<endl; this code prints 5,4. but when i pass the arrays to some function and then i print the m,n values then it is printing 1,1. i know that they are acting as pointer when i pass then in function and …

Member Avatar for Banfa
0
120
Member Avatar for nitin1

can anyone give me some good references or links or some guidelines to start with this ? i need to learn this. like i want to know how can i implement malloc, calloc, realloc etc. for this thing also, what do i need to learn firstly ? thanks. any kind …

Member Avatar for Ancient Dragon
0
146
Member Avatar for nitin1

can anyone explain me the all precison and exponent, significant bits which double can handle ? i am not getting it. wiki says it has 53 bits significant bits and 11 exponent. am a little bit confused. can anyone explain me ? (in their own way) thanks alot. although i …

Member Avatar for jephthah
0
165
Member Avatar for nitin1

can you tell me the approach that i have k*n nodes where k,n are integers and no two adjacent nodes can have same colours and i want to colour the trees with n colours. (i am making trees not graphs.) thanks. any help will be appreciated.

Member Avatar for nitin1
0
71
Member Avatar for nitin1

actually, I am trying to do digital watermarking. can you please giv me some hints of algos which i can use to do watermaking on numbers ? like i have array of numbers, then i want to water mark them with some kind of algo and also want to save …

Member Avatar for gusano79
0
109
Member Avatar for nitin1

quora.com and github.com, i am unable to open only these 2 sites from 10 days. can you please tell what is this and how can i rectify it ? please tell... thanks. :-)

Member Avatar for nitin1
0
70
Member Avatar for nitin1

why do we say science is develeped so much and it can do anything today if it wants. why dont we have treatement for kidney failure ? only dialysis ? which eats up and demolish a person's bones on per day basis. it is a silient killer. only kidney transplant …

Member Avatar for TonyG_cyprus
0
441
Member Avatar for nitin1

i want to do topo sort but i want to output the lexographically smallest topo sort vesion of that. http://www.spoj.com/problems/TOPOSORT/ here goes the link of problem. actually, i have done this using DFS , but i am able to do the question "print any possible topo sort" of the graph. …

Member Avatar for cproger
0
261
Member Avatar for nitin1

If you consider any multiple of 3 and then sum up its digits, the sum is always divisible by 3. For eg. 843 is a multiple of 3 and 8 + 4 + 3 = 15 is also multiple of 3. Similarly, for 9, any multiple of 9 satisfies the …

Member Avatar for tinstaafl
0
95
Member Avatar for nitin1

#include<iostream> #include<string> #include<vector> #include<algorithm> #include <cstdlib> using namespace std; int main() { char s[5]; string g; int p=345; sprintf(s,"%d",345); g=s; g+=".mp3"; cout<<g<<endl; getchar(); return 0; } I have a very small doubt about strings. this is code snippet i have shown. when i have called sprintf(), then it has changed …

Member Avatar for Moschops
0
163
Member Avatar for nitin1

#include<iostream> #include <cstdio> #include<string> using namespace std; typedef struct node node; struct node { int value; node * child[26]; }*root; node * newnode() { node * nn; nn=(node*)malloc(sizeof(node)); nn->value=0; for(int i=0;i<26;i++) { nn->child[i]=NULL; } return nn; } bool insert(string s) { node * temp=root; bool xx=false; for(int level=0;level<s.length();level++) { int …

Member Avatar for deceptikon
0
129
Member Avatar for nitin1

the extent of knowledge which people on daniweb has is incredible. they are GOd of thier subjects. it is a boon to me by god when i came across the daniweb. :-) thanks to all of you. :-)

Member Avatar for BigPaw
3
224
Member Avatar for nitin1

can anyone please explain me in brief that how exactly this container work ? or can u giveme some link of this. i have tried to look on some links by google, but i am not much clear about my doubt. please help me if u can. thanks.

Member Avatar for mike_2000_17
0
423
Member Avatar for nitin1
Member Avatar for nitin1

i am learning C++ from a good time now.. but I am still very confused sometimes in the use of array(char) and string.. can anyone please tell me that what exactly all differences between string and char array ? what can i do with array which i can't do with …

Member Avatar for Lucaci Andrew
0
211
Member Avatar for nitin1

i have a undirected graph and i want to print a cycle with length >=k (given) , can you suggest me a algo ? i dont want any code, snippet. i am hoping for hint and algo for this. thanks. it is guaratned that cycle of length >=k exists.. thanks.

Member Avatar for Taywin
0
142
Member Avatar for nitin1

i want to practise blood relations problems, venn diagrams, series, analogies, puzzle test, decsion making and topics resembling to them. can you suggest me a good book for these topics. they are covered under logical reasoning. please suggest the good book which you have come acrossed. thanks.

Member Avatar for aditd
0
157
Member Avatar for nitin1

actually, I am new to C++ , although not new to programming. i have a vector of pairs , vector<pair<double, pair<int,int> >> and i want to sort it in incresing order. for simplicity, i am using sort() inbulit function. does pair has ibuilt '<' operator ? or we have to …

Member Avatar for vijayan121
0
125
Member Avatar for nitin1

it is really awesome. actually i have given this idea :p and i have some credit in adding this feature to daniweb. (just kidding). in reality, programmers are really great who are behind all these things and whole crdit goes to them. hats off.. P.S who is the programmer who …

Member Avatar for <M/>
0
398
Member Avatar for nitin1

can anyone please help me in the sort function ? i have read that there are 3 way to use sort(). 1. use sort(v.begin(),v.end()) and second is sort(v.begin(),v.begin()+n, cmp) then in cmp i can have 2 varaitions, 2.a : cmp as the function (it is okay with me) 2.b. here …

Member Avatar for NathanOliver
0
226
Member Avatar for nitin1

i have an array of strings (2D array). i am taking input of strings and that strings can be same with strings which i have inputted before that string. so i want that i don't enter that string which is already being taken into array. so how can i do …

Member Avatar for deceptikon
0
131
Member Avatar for nitin1

yesterday, my RAM crashed. that was of 1 GB and now i wana purchase new one. I am thinking to buy 2 GB RAM. specifications for PC : model- HP pavellion model age: 4+ years RAM: 1 GB(initially) Processor: intel core 2DUO Hard disk: around 600 GB operating systems: Window …

Member Avatar for webjack
0
198
Member Avatar for nitin1

how can i remove my given code snippet i have submitted ? i dont want any more negative votes to my code. thanks

Member Avatar for deceptikon
0
196
Member Avatar for nitin1

Android Launch! [2012-12-14 21:55:11 - myfirstapp] adb is running normally. [2012-12-14 21:55:11 - myfirstapp] Performing com.example.myfirstapp.MainActivity activity launch [2012-12-14 21:55:11 - myfirstapp] Automatic Target Mode: launching new emulator with compatible AVD 'myfirstavd' [2012-12-14 21:55:11 - myfirstapp] Launching a new emulator with Virtual Device 'myfirstavd' [2012-12-14 21:55:16 - Emulator] Failed to …

Member Avatar for nitin1
0
151
Member Avatar for nitin1

daniweb should have a LCD looking button which will be off when that person is not online otherwise green. i have seen on many maths forumns. it is sometimes nice and helpful. we can have this feature if possible :-)

Member Avatar for Sahil89
0
377
Member Avatar for nitin1

actually, i am not asking for fun or something. I want to learn something new in these vacations. I know C, Java and moderate knowledge of php. Can you tell me something which i can learn in the vacations ? I have 1 month as vacations and ample time to …

Member Avatar for nitin1
0
526
Member Avatar for nitin1
Member Avatar for nitin1

if i want an array of 10000 ints and i just nned to use it like array only (not the functions which vector have seprately from array), then i make an array int a[10000] and vector<int>a(10000); then memory allocation time will be different for them ? if yes, then please …

Member Avatar for ravenous
0
144
Member Avatar for nitin1

#include<stdio.h> #include<conio.h> int main() { long double p=778.567; printf("%Lf",p); getch(); return 0; } it's output is : -115403.... something... why is it so ?

Member Avatar for nitin1
0
144
Member Avatar for nitin1

actually, i have given a task of a fb development. woek is that when ever any one allow the app, then that app will scan the posts and likes of that person. and that app will have database which will check that words (in posts and likes) with its database …

Member Avatar for nitin1
0
103
Member Avatar for nitin1

actually, I just want the idea here. I have a server, a client . client will request to display the files names in its directory(server's current directory). server will send the list. my thinking : system command will be used here. when clinet enter "-ls" then server will have system() …

Member Avatar for L7Sqr
0
162
Member Avatar for nitin1

i have started using C++ these days. Initially , I have done coding alot in C language. I have seen that on my onliune judges , there are 2 different versions. Why they have given 2 versions to compile the code ? Can you tell ? thanks if you can …

Member Avatar for mike_2000_17
0
453
Member Avatar for nitin1
Member Avatar for kemcar
0
126
Member Avatar for nitin1

i am using masm to write assebmly language codes. can you please tell that how can i change binary numbers to its ascii ? like 10 is given what will be its ascii value ? i know that 30h is ascii value of 0 ans so on. please help.

Member Avatar for nitin1
0
540
Member Avatar for nitin1

Can you please give me hints or can you teach me how can i convert my simple client server program(in which only client can send any number of messages it want to server) to chat server client program ? I am doing this by trivial way, but still only server …

Member Avatar for nitin1
0
2K
Member Avatar for nitin1

hello, Can anyone please tell me the most efficient know till date so as to find the prime numbers up to 10^8 or higher. I am using sieve and using odd number optimization with it also. but it is not too much effiecent which i want. Can you please any …

Member Avatar for Adak
0
112
Member Avatar for nitin1

what are they trying to say in this paragraph , I have read it 10 times, but not getting what they want to teach me here: link is this. : http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=primeNumbers and the para which is just before the euler totient theorem. am copying here also. *Or consider a scenario …

0
86

The End.