can anyone do me a project on this !! plzz
You're joking, right?
can anyone do me a project on this !! plzz
You're joking, right?
My program which is able to calculate your age, has been updated!
No offense intended, and not to diminish the effort you put into writing it, but your program isn't so interesting or clever that anybody would care about updates.
Would this work fine in replacement of fflush() ?
It would work, but I think it's excessively complicated. There's no need to store a string when you're just discarding the character. If portability is a must, and you can't switch over to general line input for some reason, I'd recommend something more like this:
/*
@description:
Reads and discards characters from the stream pointed to
by in, until end-of-file, a stream error, or a character
matching stop_at is read and discarded.
An end-of-file state is not preserved unless the stream
is otherwise in error.
*/
void discard(FILE *in, int stop_at)
{
int ch;
do
ch = getc(in);
while (ch != stop_at && ch != EOF);
if (feof(in) && !ferror(in)) {
/*
Clear the error state if this action took the stream
into end-of-file, but is otherwise error free.
*/
clearerr(in);
}
}
But that's still not a perfect replacement for fflush() because it blocks for input when the stream has no pending characters. The superior option is to read full lines so that extraneous garbage in the stream doesn't happen.
what about the changing PATH enviroment variable?
What about it?
For flushing input stream, there is a nice article in daniweb C++ forum. Check this.
And the suggested solution is also for C++ only, it won't work in C because there's insufficient framework in the stdio library to support it.
Use File.Copy(), it can recognize mapped drives as well as UNC paths.
I kind of remember that I need separate methods for the set and get too that lines 5 and 7 need to be inside of.
Yes, the "..." part is a placeholder for intervening code. Since it wouldn't compile, that's meant to show that this is a snippet. I used it so that I could highlight just the important lines of defining the property and using each of the get and set parts without junking up the example with boilerplate.
public uint[] BIG_Hash { get; set; }
...
obj.BIG_Hash = new uint[5]; // set
uint[] temp = obj.BIG_Hash; // get
The size is an attribute of the actual attached to the underlying object, not the object reference.
So we traded the below par VBulletin for the below par parser?
For one thing, that's a nonsensical comparison given that vBulletin composed the entirety of Daniweb while the current editor is a relatively small (yet important) piece.
For another thing, bwahahaha! No, the utter shittitude of vBulletin's entire source base is insanity compared to CodeMirror's parser. It's actually a miracle that Dani was able to customize even a fraction of what she did under vBulletin. We're so much better off now.
And note that I said "awkward", not "below par". It's a perfectly good parser, but there are quirks that make lookahead and lookbehind tricky. I may not need to do anything clever to support a spell checker, but with my luck that's being unreasonably optimistic. ;)
I assume a slickly designed parser will be coming eventually.
Nope, we're reasonably happy with CodeMirror now that the basic functionality has been nailed down. There was a point where code highlighting was buggy, but I think I've fixed that. Highlighting was the single biggest reason why we went with CodeMirror over other options.
I too would prefer a straight textarea, to be honest, but it's not hard to see the added value of an editor that has the feel of a native desktop application rather than an HTML form.
@deceptikon then why don't we have this spell check yet ?
Because it's not as easy as flipping a switch, otherwise we'd already have it. I could add general spell checking without too much difficulty, but it would spell check everything in code tags too. That would be super fugly given that code is assured to have many many misspelled words, so I need to figure out a way to spell check words that aren't in either code blocks or inline code without complicating the whole world.
Keep in mind that I'm working within the constraints of a very awkwardly designed parser for the editor, as well as multiple third party libraries around highlighting and formatting that need to be kept in sync. I don't doubt that it can be done, I just need to find the time to focus on it.
hm... tried that combonation and it didn't work.
And how are you testing for a correct answer?
Try using a web browser.
After 7 new messages, none of which are helpful, you can say that?
The first three of those are a question and two answers (which may be helpful), and the rest were prompted by your comment about closing the thread. Hmm... ;)
The closed status just didn't get migrated properly to the new system. I'm not convinced that it needs to be relocked anyway, given that the argument is over 5 years old and the participants are no longer active.
I think we just need to convey our message.
Poor spelling can obscure the message.
here, many people are there who are not so good in english and don't spell correctly.
Actually, I've found poor grammar to be more obtrusive than all but the most grievous of spelling errors.
Of course not. You'll need to think a little bit and infer the big O notation out of it. For example, if the time doubles along with the data, that's O(N). If it squares each time, that's O(N^2).
As the data doubles, how does the time used scale? That's your complexity.
i use clrscr(); to clear the screen but anyone knows how to clear the screen in any particular area
If you need that kind of control you should be using a console graphics library, or better yet, a full graphical application rather than the console.
You're storing passwords in the clear? That's really not a good thing. :P
A better system is to store at least a non-reversible hash of the password. Then when the user forgets their password, give them a temporary link to a reset form.
You're confusing a C program with the Linux command line.
So can anyone tell that is he wrong or i am wrong ?
You're wrong. The "command" is a Linux program that when run will send SIGKILL to the given process, which basically cannot be ignored. Your teacher clearly wanted you to use "commands" provided by the system, not write a function in C.
I'm curious though. How was your kill() function implemented?
deceptikon the question you asked are generally not asked in any job interview question, i have seen till date. i have solved around 1500 problems on various websites but i never come across such questions which you asked. google/ microsoft even facebook never asked this type of question.
That's intentional. All of the usual interview questions I've seen are stupid and tell the interviewer very little about a candidate's suitability for the position. What better questions to ask than dumbed down and abbreviated versions of what they'll encounter on the job?
I couldn't care less if you come up with a clever way to design a spice rack for a disabled person, or if you can figure out how to get a wolf, a lamb, and a sack of grain across a river. These things may tell me how you think, assuming you didn't look up the answers online before the interview, but they don't tell me jack about how you'd react to real problems or how well you'd fit into my team.
Though I do agree that the fizzbuzz program is a good way to weed out retards, and I'll use it occasionally as a first question. Others are simple but subtle algorithms like a binary search, or a safe copy in the presence of overlapping memory. These can promote conversation.
p.s i am talking about questions which company aksks to a student who has just completed his graduation like me.(after b.tech or bba or something …
"Management system" is incredibly vague. Can you be more specific?
You're effectively checking that a is equal to b and a is equal to c.
You mean checking if a is equal to b is equal to c. Or in other words, if a == b
and c == 1
or a != b
and c == 0
. The result of a boolean test is 0 or 1, and the evaluation is ((a == b) == c)
. Or in multiple lines, which highlights the problem more readily:
int temp = (a == b);
if (temp == c) {
...
}
1) Questions you frequently ask people/expect people to know?
I like to ask questions based on real world challenges I've encountered within the target domain. I absolutely despise the tricky questions, riddles, and Google/Microsoft questions that have been all the rage lately. I also don't believe in just testing book knowledge. Any idiot can read documentation; it takes something more to develop robust software.
When you face me, you'll get something like:
Q: You're tasked with writing a Windows service that polls a network folder for image files, performs cleanup, and finally imports the files into capture software for OCR. How would you maintain file integrity throughout the process? What if the client needs the ability to audit the process at each step? What if the client requests that the service be distributed across multiple servers for high availability?
2) General duration of the interview?
Generally 30-45 minutes unless I end it early so as not to waste both our time interviewing someone who clearly won't make it.
3) Your first interview? :)
Interviewer: "This job sucks, do you want it?"
Me: "Yes."
I was interviewing for a system administrator/IT technician position. The interviewer would end up being my manager, and he was right about it sucking. ;)
4) Preparation for facing one?
I don't really believe in preparing for the interview. If you really want the job you'll do at least minimal research on the company without being told, and …
Geeks' Lounge and Community Center would probably be the best place, though if it's directed at C interviews the the C forum is also appropriate. And I don't care who starts the thread (you or myk45), just coordinate so that you don't both make one. ;)
perhaps creating a new thread for this is appropriate?
I think that would be best.
but what to do in a situation when we don't know the answer fully correctly.
Say what you know and admit that you're not sure. You'd be shocked at how few people seem capable of saying "I don't know". In fact, it's so ridicuous that merely admitting you don't know the answer and suggesting ways to find it can land you a job all by itself.
Acting as an intrviewer from any company ? it's a great job!
It's not really that big of a deal.
i afraid from them like they will eat me if i say something wrong ;)
While some nervousness is understandable and overly confident people raise red flags in an interview, being afraid of the interviewer is a bad thing. In my first programming interview (as the candidate) I wouldn't back down when the interviewer thought my answer to a question had a bug and I knew it didn't. I got that job over other, probably better, candidates because I was willing to fight when it mattered. Backing down and changing code to fix an imaginary bug very often introduces real bugs, and that can end up being a very costly mistake.
Have you ever gone as a interviwer to any university or college ?
No, but I regularly interview candidate programmers looking for a job in the real world.
i mean it is not a well defined answer if a high-grade person(interviewer/teacher/professor) asks and i counter question him/her like this.
I'd accept that answer as an interviewer. It clearly and eloquently (in my opinion) shows that you understand the issues involved.
if anyone asks me why sizeof is an operator not a function, then what exactly (very specific) i should say him/her
I'd ask a socratic counter question: how would a function (an inherently runtime entity) execute at compile time?
Type information is lost after compilation, that's why C decompilers suck ass. We've discussed this.
I don't understand the "question". Please elaborate.
You could also use memcmp
You could, and it might work, but it's not guaranteed for anything but arrays of character type. See if you can figure out why. I'm really busy right now and can't elaborate.
why it doesn't hold for C++?
I'd suspect that the person who wrote that was thinking of C++'s RTTI (runtime type information) features. That really has nothing to do with the sizeof operator though.
We use a third party library to linkify URLs, and it doesn't handle URLs with embedded parentheses. Handling parens is actually rather tricky because you have to consider parens that aren't part of a URL (like (www.google.com)). We'd also need to integrate the change into Markdown and the editor highlighting so that there's not a disconnect between what you see and what you get (these are wildly different designs, by the way, which complicates the changes). Finally, Dani also doesn't like me fiddling with those libraries because then we'd be locked into a specific version.
That's why it's the way it is presently. ;)
You can fix it by using the Markdown link syntax directly rather than depending on the linkify feature:
Im asking if there is an availeble function
Not in the standard library, at least not to the extent that I suspect you want. I'm sure you can find a third party library or extensions supported by your compiler (such as itoa()), but nobody can help you with that since you didn't specify your compiler or OS.
as you see isnt there a way like this or a function to do this ?
The comparison operator doesn't work for arrays. Use a loop and write your own function:
int compare_array(int a[5], int b[5])
{
for (int i = 0; i < 5; ++i) {
if (a[i] != b[i])
return a[i] < b[i] ? -1 : +1;
}
return 0;
}
This can be generalized with templates, but I won't overwhelm you with what ultimately looks like line noise. ;)
thank you so much
I hope you're not expecting someone to just give you the code. Even if you provided sufficient requirements to write these functions, doing so is against Daniweb's rules because you've show no effort in doing the work yourself.
but I'm nub sooo, what is compiler flag?
It's an option added to the command line invokation of the compiler. Right now you're probably only using something like this:
$ g++ myprogram.cpp
But you can add a huge number of options in the form of flags. For example, to only compile the code and not link it into an executable you'd use the -c option:
$ g++ -c myprogram.cpp
And then to link it into an executable separately from the result of the previous invokation, this:
$ g++ myprogram.o
Compiler options will take the form of either -<option> or --<option>, and you can find a complete list of them here.
by the way, The code works for Turbo C, it doesn't work for gcc.
Which should be your first hint that the code is wrong. If it were right, all compilers would produce the same result.
I think the answer to the question is that scanf is not able to allocate memory for the input string properly
That's indirectly correct. The actual problem is that you were making assumptions about what scanf() is supposed to do, and failed to read the documentation to verify your assumptions. The fact that scanf() is indeed unable to properly allocate memory for the string is an irrelevant point because it's not intended to do so.
so it is having problem in assigning base address of the allocated string to the character pointer.
No allocation happens. scanf() writes to the address stored in the pointer you pass, and it's your job to make sure that the pointer points to enough memory to hold whatever length string scanf() might write to it. You passed an uninitialized pointer, and scanf() rightfully puked when it turned out that the garbage address stored by that pointer didn't refer to memory that your process properly owned.
Yes, we can help you. Please ask specific questions beyond "can you help me?" (the answer is yes) and "what statements can I use?" (the answer is any of them).
Are you currently running Windows 7 64-bit?
I'm getting mixed signals here. What are you looking for? ;)
Do you have a more specific question? I'm not keen on writing an exception handling tutorial.
Arrays are an aggregate type, you can't simply use the assignment operator. Copying is performed with the strcpy() function. argv[1] is also a string, so *argv[1] evaluates to a single character. I suspect you meant this:
strcpy(target, argv[1]);
Your situation sounds perfect for going to university. You'll have a better idea of whether you want to do something with computers after taking classes and and if nothing else leave with a degree that will help you get a job.
in the 21st century, it is a world of multitasking dude!
When I divide my attention between projects, the quality of my work decreases exponentially. Just FYI, even in a world of multitasking, focus is important.