3,183 Posted Topics

Member Avatar for general2012

This: strncpy(p->name[(p->count)++], q, 20); Is roughly equivalent to this: strncpy(p->name[p->count], q, 20); ++p->count; I'm not sure where your confusion lies, but I'm all but certain you're overcomplicating things.

Member Avatar for general2012
0
150
Member Avatar for vikuseth

> I know the header files are never compiled. Header files are always compiled if you include them. The problem is that you have an object definition in a header file, which means that by including it more than once you've violated the one definition rule. Inside the header you …

Member Avatar for mike_2000_17
0
231
Member Avatar for jamespope44

Your call to mysql_query() failed and returned FALSE. Use [mysql_error()](http://php.net/manual/en/function.mysql-error.php) to get details as to why the query failed.

Member Avatar for deceptikon
0
274
Member Avatar for RockJake28

`toMakeFood` doesn't exist because everywhere you have a declaration of it, you're saying "defined elsewhere" due to the `extern` keyword. Add an includes.c file with this: bool toMakeFood = false; And don't forget to link that file in with the rest. The header will provide multiple delcarations while the .c …

Member Avatar for deceptikon
0
303
Member Avatar for aslam.junaid786

The compiler is right. You declare copies without initializing it, then immediately try to print its value. That's undefined behavior, and constitutes a bug.

Member Avatar for aslam.junaid786
0
927
Member Avatar for TheBrick

I'd mention that the code works on my end and ask how they're testing it on their side. Make it clear that you respect their decision to halt the interview process and that you're most interested in learning what you may have done wrong.

Member Avatar for mike_2000_17
0
139
Member Avatar for IwalkAlone

> *t=*t; This accomplishes a whole lot of nothing. All you're doing is simulating the effect of strlen() without the overhead of a function call, so no assignments are necessary. Just bump the value of `t` until it's pointing to a null character: while (*t) ++t; You also don't use …

Member Avatar for ahmedhamdy
0
2K
Member Avatar for Clanstrom

Such a list would be subjective no matter how you look at it because everyone has different goals and problems that need solving. A better approach is to consider each problem you have when you have it and then ask if there's a function out there that already does it. …

Member Avatar for diafol
0
221
Member Avatar for celina1234

You're focusing too much on the little things and not seeing the big picture. The problem is very simple: display any line where the first non-whitespace character is a digit. To do that you read each line in turn, find the first non-whitespace character, and print it if it's a …

Member Avatar for deceptikon
0
123
Member Avatar for BigPaw

> I don't know of any IDE's that exist on them. There are IDEs, editors, and compilers that run on a tablet...but they all suck. However, it doesn't strike me as unreasonable to use something like Ideone to write and compile code, then copy/paste it into a post all on …

Member Avatar for deceptikon
1
122
Member Avatar for THEboss007

There aren't equivalent headers unless you're using a compatibility layer. A better approach would be to port your code based on features, and look for equivalent features in the Windows APIs.

Member Avatar for THEboss007
0
959
Member Avatar for pjh-10

> having trouble finding this anywhere, on a 32bit computer, how many bytes does it take to store ; long int, unsigned char,float, double You're having trouble finding it because there's no absolute answer. Only char has a guaranteed size (it's always going to be 1), the rest are implementation …

Member Avatar for vmanes
0
228
Member Avatar for James19142

> I dont use memcpy often As well you shouldn't. memcpy() is a very low level function that was inherited from C. The problem with memcpy() in C++ is that it doesn't respect class structure or construction/destruction, so unless you have what is called a [POD](http://en.wikipedia.org/wiki/Plain_old_data_structure) type, use of memcpy() …

Member Avatar for James19142
0
2K
Member Avatar for dan.ruffcorn

> Modify the Downdog Yoga Studio program This suggests that you have pseudocode from a previous exercise and the current exercise is an extension of it.

Member Avatar for deceptikon
0
90
Member Avatar for gamnlxvi

> i would like to enter 6 random objects on this grid that the arrow can pick up where would i enter the random number generator to put them on the grid? I'd put them in SetupScreen(). Once you're done filling the grid with dots, randomly generate six different coordinates …

Member Avatar for deceptikon
0
549
Member Avatar for inneedofhelp123

> To do this, you have to use Win32 (Windows API). Um...to determine the OS you need to use the Windows API? Doesn't that presume that the OS is Windows and then you're just drilling down to the exact version? ;)

Member Avatar for mike_2000_17
1
6K
Member Avatar for general2012

> `number *p;'` > `p->count=0;` This is a classic error with pointers. A pointer **MUST** point to a valid object that you own. If the pointer is uninitialized, as in the two lines above, you **CANNOT** dereference it...period, full stop, no exceptions. Once you initialize the pointer, all will be …

Member Avatar for general2012
0
2K
Member Avatar for Kert

`p_array` is a pointer. When you use the subscript operator, that pointer is dereferenced. In other words `p_array[index]` is functionally identical to `*(p_array + index)`. Now, when you dereference p_array, the result is also a pointer, specifically a pointer to char. So this line is correct because the %s specifier …

Member Avatar for Kert
0
309
Member Avatar for artur.sinelnikovs
Member Avatar for lalitha2294

You need to break the line up such that the ID can be compared. If subsequent details also need to be treated separately then strcmp() and strtok() come to mind as a viable first attempt: #include <stdio.h> #include <string.h> #define WHITESPACE " \t\n\r\f\v" int main(void) { FILE *in = fopen("test.txt", …

Member Avatar for lalitha2294
0
159
Member Avatar for nivedita.valluru

> How to call a C++ function which is compiled with C++ compiler in C code? The function must either be compiled with C compatibility in place or wrapped in such a function, otherwise C won't be able to recognize it due to C++'s name mangling conventions: extern "C" { …

Member Avatar for deceptikon
0
104
Member Avatar for mike.mcwhinney.3

> I get an error message about MDAC 2.6 or greater needs to be installed. Have you tried installing MDAC 2.6 or later? While I wouldn't recommend Access as your database, simply because it's not scalable and I've had bad experiences upgrading people who started with Access to a *real* …

Member Avatar for deceptikon
0
146
Member Avatar for AndrewEPage

> Can someone explain why this would be a good idea? It's a little more natural syntax for setters and getters. > It seems like a lot of work for little benifit. Indeed. I personally wouldn't use it unless the problem domain suggests a distinct benefit, but I also have …

Member Avatar for mrnutty
0
3K
Member Avatar for <M/>

> Oh and by the way, is it okay to post in purple? Like i just did now? It's okay, but you're technically not posting "in purple". You're posting with heading tags, which may change their look and feel to be something other than purple. If that ever happens, full …

Member Avatar for <M/>
0
187
Member Avatar for Vish0203

> My question is HOW?? When I closed the file then how it can be in use of some other process?? My gut reaction is to say that this is a timing issue, but it's possible that fclose() failed. First try testing the return value to see if there were …

Member Avatar for Vish0203
0
87
Member Avatar for Moein313

Top down means starting at the highest reasonable level and then digging into details. It's an overall structure based approach rather than bottom up, which is more of a progressively evolving functionality approach (starting with the details and working up).

Member Avatar for deceptikon
0
43
Member Avatar for Alexkid

Somehow I get the impression that he wants numeric values rather than strings. In that case it would be necessary to either convert the string to a number or build the number directly. For example: #include <algorithm> #include <cctype> #include <iostream> #include <string> int digit_value(char ch) { const std::string digits …

Member Avatar for deceptikon
0
4K
Member Avatar for silvercats

> Debugger shows this as 1515804759 in Decimal. that is when 5958595a taken as a whole. > why doesn't it show 87888990 like when they are take separately? Because eax is being interpreted as an integer value instead of an array, so all four bytes are a single entity totaling …

Member Avatar for silvercats
0
163
Member Avatar for kborana
Member Avatar for deceptikon
0
42
Member Avatar for christinetom

> If I want some software which can be compiled as part of my application / project etc, something which has little or no reliance on external programs (all packed in as part of my program) then what is that called. I'd call it standalone software, assuming you mean a …

Member Avatar for christinetom
0
91
Member Avatar for silvercats

> 1.If cin and cout objects are in the 'iostream' , why do we need to declare it again using 'std' ? <iostream> is the header that contains declarations. Without those declarations your compiler doesn't know that the names you use exist. The names themselves are declared within a namespace …

Member Avatar for silvercats
0
130
Member Avatar for saleem.mukhtiar

You can have an identity column with autoincrement properties that isn't the primary key. In the new table, just create the new column, set it to identity "Yes", and with increment step and seed of 1.

Member Avatar for tsmorris
0
113
Member Avatar for gunvinayaka

What you're asking for is a [random shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).

Member Avatar for deceptikon
0
402
Member Avatar for awaisahmad13

I'm having trouble deciphering that incomprehensible mess. Could you please rephrase your question?

Member Avatar for rotenegg
0
218
Member Avatar for nitin1

Note that this is a dual feature, and the second part makes the first part less useful. If we implement some sort of notification that people are online, we'll also need to include a way to disable it and allow people to be invisible. Otherwise it has too much of …

Member Avatar for Sahil89
0
377
Member Avatar for Mikey12345

So...have you looked into the documentation for the [ProgressBar](http://msdn.microsoft.com/en-us/library/system.windows.forms.progressbar.aspx) control?

Member Avatar for tinstaafl
0
399
Member Avatar for Grandiago

> but then i thought what if the user inputs a 2 digit number or a 3 digit number? You'd need to extract tokens rather than characters. For example: #include <ctype.h> #include <stdio.h> #include <string.h> typedef enum token { UNKNOWN, VALUE, OPERATOR, VARIABLE } token_t; token_t next_token(char buf[], size_t size) …

Member Avatar for Grandiago
0
321
Member Avatar for tomz6

> You could declare a char[BUFSIZ]. It is a max length your system can use. Um...no. BUFSIZ is a macro representing the size of the default buffer used by the stdio library. It's nearly always a great deal less than the maximum length string you could define. BUFSIZ also doesn't …

Member Avatar for deceptikon
0
168
Member Avatar for artur.sinelnikovs

You've cut and pasted parts of the code but neglected to modify everything. For example, in the file_w part of the code you're still working with fileread rather than filewrite. Compare and contrast with this corrected code: #include <stdio.h> #include <string.h> #include <stdlib.h> int main(void) { FILE *file_r, *file_w; int …

Member Avatar for deceptikon
0
190
Member Avatar for Cw Will
Member Avatar for Begginnerdev

The comparison delegate returns an integer denoting the relation between the two objects: 0 for equal, -1 if x is "smaller", and +1 if x is "larger". So it would be more like this: Private Function SortMyList(ByVal x As MyType, ByVal y As MyType) As Integer Dim tsX As TimeSpan …

Member Avatar for Begginnerdev
0
450
Member Avatar for kaywt

So it looks like you're not actually doing a full merge sort, you're just merging together three arrays that are already sorted. Really the only tricky part of this is taking what you know about merging two arrays and extending it into three. Here's a two way merge: int dst[size …

Member Avatar for kaywt
0
179
Member Avatar for vikuseth

A static member is shared between all objects of the class whereas each object of the class contains a copy of the instance member. It's really as simple as that, though the `static` keyword is heavily used for different purposes in C++. [LearnCpp - Static Members](http://www.learncpp.com/cpp-tutorial/811-static-member-variables/) [IBM Reference - Static …

Member Avatar for deceptikon
0
181
Member Avatar for davecoventry

If `char` could represent the same thing as `wchar_t` then there wouldn't be two different types of characters. You have a wide string, and thus you need to either convert it to a narrow string *iff* you're sure that the narrow string can represent it, or properly display the wide …

Member Avatar for deceptikon
0
178
Member Avatar for liljaw2706

Pseudocode is just a formalized list of steps, there really aren't any rules beyond generally trying to remain consistent and logically sound. So *your* job is to break the assignment into component parts. What steps are involved? What order are the steps in? For example, it's not unreasonable to have …

Member Avatar for T-Dogg3030
0
227
Member Avatar for monching

Is this a question about the DateTimePicker or about MySQL? If it's the former then the control has a Value property that gives you the stored DateTime object. You can then get the long format as a string and save it to MySQL: Dim longdate As String = dateTimePicker1.Value.ToLongDateString() ' …

Member Avatar for monching
0
224
Member Avatar for Xufyan

Here's pseudocode for what you're doing: cx = 10 while cx <> 0 while cx <> 0 int 21h dec cx loop dec cx loop So cx starts out as 10 and gets decremented to 0 by the inner loop. Then the outer loop decrements it again to make it …

Member Avatar for sbesch
0
3K
Member Avatar for Dark_Knight

> after getchar i use another getchar to clear the buffer Though there's no guarantee that the second character is a newline, so you're making an unwarranted assumption about the user's behavior.

Member Avatar for jigar23
0
2K
Member Avatar for salma.zaki.31

You're aware that this is the very first program anyone learning assembly will have to write, and it's **ALWAYS** provided in toto by the teaching resource (ie. book, website, or course notes), right? So either you're lazy to the point that shocks even me, or you need to ask a …

Member Avatar for Fix_It
-1
93
Member Avatar for artur.sinelnikovs

> argv[0] is always the program name. Not always. *If* argc is greater than zero, argv[0] is allowed to be an empty string, should the program name not be available for some reason. Even if argv[0] isn't an empty string, the format of the "program name" is implementation dependent. It's …

Member Avatar for deceptikon
0
163

The End.