3,183 Posted Topics

Member Avatar for 3e0jUn

Wildcards are interpreted by the shell before your program gets a chance to touch them. If you want them passed as literals, then escape them so that they're not interpreted as wildcards: $ python ./arch.py install \*

Member Avatar for deceptikon
0
201
Member Avatar for terabyte

> There is no pass by value when it comes to a function with array as the parameter. It's the other way around. There's no pass by reference in C, period. When passing an array, you're passing the address as a pointer *by value*.

Member Avatar for deceptikon
0
166
Member Avatar for evilguyme
Member Avatar for tom.hank.315213

> `define('DB_NAME', 'lol);` Count the single quotes in that line.

Member Avatar for tom.hank.315213
0
90
Member Avatar for asifalizaman

> You should use <iostream> and <cmath> (all C++ standard headers don't have the .h, and all those taken from C (like math.h, stdlib.h, stdio.h, etc.) also omit the .h and are prefixed with the letter c). It's also important to remember that some compilers (Microsoft's in particular) "helpfully" don't …

Member Avatar for asifalizaman
0
354
Member Avatar for HankReardon

> With three programming courses under my belt will I be able to find a job out there in the real world? Getting a programming job has less to do with how much you know about programming and more to do with selling yourself. So while I'd say that right …

Member Avatar for deceptikon
0
353
Member Avatar for ellenski

At its simplest you'd have something like this just to store the characters: #include <stdio.h> #define EXPR_MAX 255 int main(void) { FILE *in = fopen("c:\\test1.txt", "r"); if (in) { char expr[EXPR_MAX]; size_t n = 0; int ch; while ((ch = getc(in)) != EOF) { expr[n++] = (char)ch; } fclose(in); /* …

Member Avatar for deceptikon
0
280
Member Avatar for dan.gerald
Member Avatar for MRehanQadri

Using the initializer list you can take advantage of initialization rules: #include <iostream> using namespace std; struct a { double id; int tag; char array[10]; }; int main() { a var1 = {100, 1, "The City"}; a var2 = var1; cout << "var2.id = " << var2.id << endl; cout …

Member Avatar for MRehanQadri
0
102
Member Avatar for MRehanQadri

> But can you tell me why in the definition of f1 (in your code) p's address has not been passed and still it's passed by reference? The entire point of using another level of indirection is so that you can access the original object. If you already have that …

Member Avatar for MRehanQadri
0
183
Member Avatar for asifalizaman

[Read the documentation](http://msdn.microsoft.com/en-us/library/windows/desktop/aa376868(v=vs.85).aspx), it includes [an example](http://msdn.microsoft.com/en-us/library/windows/desktop/aa376871(v=vs.85).aspx).

Member Avatar for deceptikon
0
465
Member Avatar for almighty_08

So you're supposed to do this project, but you're asking for someone to send it to you? I'm sorry, but that sounds a lot like you're asking others to do your project for you.

Member Avatar for deceptikon
0
207
Member Avatar for Ashenvale

Assuming the time part of your date is consistent (such as midnight), it's a simple check against getdate(): "select * from usernames where [Username] = '" & TextBox2.Text & "' and [Password] = '" & TextBox1.Text & "' and [ExpiresOn] >= getdate()" You might also consider using parameterized queries instead …

Member Avatar for Ashenvale
0
142
Member Avatar for AzizTitu

> Yes, it is possible but it is not recommended. Why? > It is better to have dynamically allocated array in this case. Again, why? Please assume that the compiler supports C99, since the obvious "it's not portable" prior to C99 is obvious. > `int *array = malloc(i*sizeof(int)); // alloc …

Member Avatar for deceptikon
0
243
Member Avatar for <M/>

According to [the manual](http://msdn.microsoft.com/en-us/library/70x4wcx1.aspx) WriteLine() returns void, you can't assign that to `answer[i]`.

Member Avatar for tinstaafl
0
224
Member Avatar for timwhelan

I assume you're asking about the ternary operator. This: 'left': (direction === 0) ? '-100%' : '100%' Is roughly equivalent to this: if (direction === 0) { 'left': '-100%'; } else { 'left': '100%'; } So it's just a expressionized version of an if..else statement.

Member Avatar for lambing
0
175
Member Avatar for craig.durnin.1
Member Avatar for mc3330418

> What I don't understand is, would a real world program have a default constructor AND a constructor with parameters? Certainly, if there's a case where the class could initialize itself to a predictable state without help from the caller. One example might be an empty string, so std::string has …

Member Avatar for mc3330418
0
146
Member Avatar for sami youssef

[How would you do it on paper?](http://www.wikihow.com/Convert-from-Decimal-to-Binary) The first task is to understand the problem and solve it manually, step by step. Then you'll be in a better position to translate those steps into C++.

Member Avatar for rubberman
0
152
Member Avatar for ellenski

> I would appreciate it if someone can put more detailed comments in this source code to help me better understand it. Sorry, but no. There won't always be someone around who's both capable and *willing* to read, understand, and recomment large amounts of code just to make things easier …

Member Avatar for deceptikon
0
309
Member Avatar for aVar++

Both...not at the same time though. I'm a tea snob, but I also love a nice cup of joe.

Member Avatar for <M/>
0
186
Member Avatar for boy.frenzy

Manually? With Excel scripting? Using third party code using an Excel library? Your question is specific as far as what you want to happen, but vague in terms of how you're looking to accomplish it.

Member Avatar for boy.frenzy
0
205
Member Avatar for MRehanQadri

Pointers are built-in types, they don't have constructors per se. If you want your ppointers to be null, make them null explicitly. student *head = 0; student *tail = 0; Assuming those pointers are members of another class then you can certainly use the default constructor to make them null.: …

Member Avatar for Moschops
0
171
Member Avatar for Ancient Dragon

> The most common password is "123456" I used "12345" for the longest time on my Hotmail account. Then they changed the requirement to 8 characters and it became "12345678". :D p.s. I use a much stronger password now, so don't bother trying either of those. > I use almost …

Member Avatar for vegaseat
4
242
Member Avatar for joel.blundell.5
Member Avatar for Ancient Dragon

> what is the PFO page...? http://www.programmingforums.org/

Member Avatar for deceptikon
0
175
Member Avatar for handsomelaw

> i dont know how to go about it Please read [this thread](http://www.daniweb.com/software-development/csharp/threads/448647/new-programmers-what-resources-are-available-to-you). It's about C#, but the general message is very relevant.

Member Avatar for rubberman
0
114
Member Avatar for desolatebeast

> _getcwd() is a win32 api function. Not sure the replacement for *nix getcwd() in <unistd.h>. ;) For processing the contents of a directory, you'd probably end up using opendir(), readdir(), and closedir(): DIR *dir = opendir("."); if (dir) { struct dirent *info; while ((info = readdir(dir))) { cout << …

Member Avatar for desolatebeast
0
395
Member Avatar for adfsandfianfosdaafs

Keep a running sum of the numbers, that way you can keep a single variable for the currently entered number and reuse it in a loop.

Member Avatar for deceptikon
0
104
Member Avatar for bhatehardika

Start by listing the features you want to support, as those will tend to dictate your implementation more than anything.

Member Avatar for diafol
0
188
Member Avatar for softwaretime

Handle the [form closing event](http://msdn.microsoft.com/en-us/library/system.windows.forms.form.formclosing.aspx).

Member Avatar for deceptikon
0
232
Member Avatar for Bhavya scripted

Of the listed languages, Perl is the closest to C/C++. Python and Lua are syntactically in different families. By the way, if by "hacking" you mean breaking into systems and such, please note that Daniweb does not allow that kind of discussion.

Member Avatar for mattster
-1
225
Member Avatar for Bhavya scripted

Here's a simple example: #include <iostream> class foo { public: virtual void action() const { std::cout << "foo\n"; } }; class bar: public foo { public: virtual void action() const { std::cout << "bar\n"; } }; class baz: public foo { public: virtual void action() const { std::cout << "baz\n"; …

Member Avatar for deceptikon
0
177
Member Avatar for Mike Askew

> It may seem clever but I find it condescending ("Don't worry about how it's done. It's magic - whoo") and unprofessional. As for your reasoning, I don't completely agree: * Condescending: That's a problem with your sensibilities, not the word choice. Changing it to "automatically" doesn't change the fact …

Member Avatar for Dani
0
214
Member Avatar for MrProgammer

Everything *must* be declared before it's used. A function prototype is the function signature without a body and terminated by a semicolon: #include<conio.h> #include<stdio.h> #include<math.h> int input_data1(void); void display(void); void main(void) { input_data1(); } int input_data1(void) { int input; printf("\n\n**************CPU Scheduling*************\n"); printf("|\tChoose CPU Scheduling:\t\t|\n|\t1. Shortest Job Next\t\t|\n|\t2. First Come First …

Member Avatar for MrProgammer
0
144
Member Avatar for otengkwaku

> Home sick in bed with a cold. You work too hard. Well, then again it could also be that you just party in the city too often. ;)

Member Avatar for Ketsuekiame
3
665
Member Avatar for <M/>

I've been using Windows 8 exclusively at home for a few months now and haven't experienced any problems in IE, Chrome, or Firefox. The problem you're describing sounds a lot like a zoom issue. Reset your zoom (usually with something like ctrl+0) and see if that fixes the "awkward".

Member Avatar for <M/>
0
285
Member Avatar for waqas.zafar.125

There are a number of problems with your code. Most notable are the sort doesn't actually sort, you're not actually using an array, and inputFromUser() is storing data in a local variable that gets leaked away on every iteration of the loop. Worse, you're in SortArray() assuming that this not …

Member Avatar for tinstaafl
0
213
Member Avatar for Ketsuekiame

Sometimes it takes several seconds to fully submit the post and refresh the thread. How long did you wait before concluding that the post was not submitted?

Member Avatar for Ketsuekiame
0
252
Member Avatar for hckrwb

> void permit a function without return type.... `void` *is* the return type. You just can't do much with it. > Just to add, it is not considered good programming to write void functions That's not true at all. Please don't conflate your own personal preferences with generally accepted good …

Member Avatar for deceptikon
0
300
Member Avatar for chriswelborn

> was it 3 hours before the big update you did a while back or was i just plain wrong? Nope. If memory serves me it may have once been 15 minutes, but was never more than 30.

Member Avatar for Dani
0
843
Member Avatar for Nirav.gohel23

> This blog is created for the students of computer field and sharing the programming concept to the people of IT. That's a shame. In a perfect world, people would learn before trying to teach. Kudos for going to the effort, though.

Member Avatar for deceptikon
0
149
Member Avatar for RozenKristal
Member Avatar for king03

Let's start with [int 21h](http://www.ctyme.com/intr/int-21.htm), because it seems like magic if you're not familiar with the multipurpose functionality. It behaves differently depending on the value of the AX register. mov is just shuffling data around, I'm not sure I need to explain it unless you have a specific question. Line …

Member Avatar for deceptikon
0
219
Member Avatar for krystosan
Member Avatar for vegaseat
0
482
Member Avatar for anumash

> Check out fseek() to smartly maneuver around a file. Note that arbitrary seeking on a stream opened in text mode is technically undefined. To use anything except an offset of 0 or the result of a previous ftell() call, the stream must be opened in binary mode. > Also, …

Member Avatar for deceptikon
0
306
Member Avatar for anumash

In text mode the newline sequence will be converted to '\n', this is true for any platform. In binary mode you're on your own, no translation will occur so on Windows you need to look for and handle newlines in the form of CRLF. But it's problematic because you can …

Member Avatar for deceptikon
0
214
Member Avatar for bukhtoyarov.vladimir.7

Clearly not an interview question as such a question would be illegal (in both your country and mine).

Member Avatar for deceptikon
-3
258
Member Avatar for ram619

> Please tell me how to optimise. Delete the printf() line. I/O constitutes some of the most, if not *the* most time intensive operations. On a side note, your code exhibits undefined behavior by accessing uninitialized memory. There's no guarantee that the program *won't* crash intermittently.

Member Avatar for Adak
0
205
Member Avatar for hr3lkq

Just to be clear, are you using Turbo C++ because you're forced to by a teacher or employer, or because you've chosen to use it? Because if it's the latter, I'd *strongly* recommend installing a compiler that isn't over 20 years old.

Member Avatar for deceptikon
0
32

The End.