636 Posted Topics

Member Avatar for balajirs

Yes you can (sort of), however it is fairly non-trivial. The last parameter to sa_sigaction is a pointer to ucontext_t of a faulting context. Among other things, it includes uc_mcontext (describing the complete state of the cpu). It in turn contains a gregset array og general purpose registers. Now, gregset[REG_EIP] …

Member Avatar for balajirs
0
157
Member Avatar for Aarowaim

You never change the clipboard contents. You only copy the text into some global memory, which has no association with a clipboard. Look at SetClipboardData function.

Member Avatar for Aarowaim
0
274
Member Avatar for DJSAN10

Look [URL="http://webster.cs.ucr.edu/Page_TechDocs/pe.txt"]here[/URL], specifically in the discussion of "bound imports". This is the only use I am aware of.

Member Avatar for DJSAN10
0
451
Member Avatar for CY0T3R

Add the line [CODE] cout << "fact = " << fact << endl;[/CODE] right after line 24, and see what happens.

Member Avatar for CY0T3R
0
221
Member Avatar for samidha

Most of the linux development is driven by commercial enterprises. Linux is a great vehicle to sell the hardware to OEMs, be it in form of an evaluation kit or a reference design. Every hardware designer wants linux to run on their platform; usually up to 10% of the software …

Member Avatar for jbennet
0
156
Member Avatar for halien

The Ubuntu version does not match the original. For example, [ICODE]-L/usr/local/difmap2.4k/lib -lsphere[/ICODE] has different meaning than [ICODE]-L/usr/local/uvf_difmap/lib/libsphere[/ICODE] Try this: [CODE]g++-4.5 -o splitc splitc.o -L/usr/local/uvf_difmap/lib/ -L/usr/lib/x86_64-linux-gnu -lsphere -llogio -lpager -lcpgplot -lpng -lpgplot --lX11 -lfits -lrecio -lscrfil -lslalib -ltecla -lcurses /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5/libgcc.a[/CODE] As of what to do with the build script, make sure …

Member Avatar for halien
0
224
Member Avatar for Labdabeta

[QUOTE] X-- --- --- Perfect 1st move for Tic Tac Toe![/QUOTE] To begin with, I wouldn't call it perfect. Now, if you are sure that the alpha-beta works correctly (I didn't bother to check), then the problem must be in a statical evaluation. And it is there indeed. Hint: pay …

Member Avatar for Labdabeta
0
1K
Member Avatar for sagarnarasgonde

[QUOTE]Is there another way I am not considering? [/QUOTE] [CODE]> gcc -c foo.c > gcc -c bar.c > gcc -o baz foo.o bar.o >[/CODE] Of course an object file can be linked. In fact, only the object files are linked. A library is a convenient way to package a collection …

Member Avatar for Moschops
0
168
Member Avatar for Gaiety

It is a very bad habit to use an asterisk in the dependency. Consider the situation: foo.c bar.c are the sources. For some reason foo has been compiled into foo.o, but bar.c was not. The directory contains foo.c, bar.c, and foo.o. The dependency *.o at line 4 in your makefile …

Member Avatar for Gaiety
0
184
Member Avatar for jonnyboy12

0. The installer makes end users comfortable. 1. An end user is more or less sure that the thing she installs is what it claims to be. See bullet 0. 2. Most applications need third party libraries, drivers, services, registry settings, and whatnot (not to mention previous versions and cross-version …

Member Avatar for adityatandon
0
122
Member Avatar for jeffw362

[QUOTE]Does anyone have any ideas?[/QUOTE] Of course. Assigning a pointer does not copy the string contents: [CODE] g_ppRecords[g_numRecords]->firstName =(char*) malloc(sizeof(token)); g_ppRecords[g_numRecords]->firstName = token; [/CODE] Now firstName points to token, not the memory you've allocated. That is, firstName in every record points somewhere into the input array, and most likely to …

Member Avatar for nezachem
0
238
Member Avatar for Alexis913

You calculate the position of the new environment variable (line 81) based on the length of the current one. It is OK as long as you use the original length. In case of PATH it is not so.

Member Avatar for Alexis913
0
5K
Member Avatar for vedro-compota
Member Avatar for andrew1532

First of all, explain the loops [CODE] for (Y=y1; y2!=Y ;Y++){[/CODE] at lines 110 and 144. I am asking because the loop parameter Y is not used in the loop body. Second, (re)read [URL="http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm"]an article[/URL] on a Bresenham algorithm until you understand completely how it works.

Member Avatar for nezachem
0
199
Member Avatar for Nikhar
Member Avatar for deceptikon
0
114
Member Avatar for jaskij

The problem is that a Weierstrass product converges very poorly (my gut feeling is that it is worse than linear; correct me if I am wrong). That is, even 1e8 iterations may not be enough.

Member Avatar for jaskij
0
212
Member Avatar for silvercats

[QUOTE]skip 16bit it is dead[/QUOTE] I wouldn't be so definite. 16-bit is very well around (and, ugh, 8-bit too). Their niches are very specific indeed, but really, 8-bit is the only area where assembly programming skills still have value.

Member Avatar for silvercats
0
168
Member Avatar for shubham.joy

[ICODE]#define[/ICODE] is a textual substitution. The expression expands to [CODE] i < j > k? j: k[/CODE] I leave it as an exercise to figure out the actual precedence. To avoid such mess, you need to be more explicit: [CODE]#define max( a, b) (a > b ? a:b)[/CODE] Notice an …

Member Avatar for nezachem
0
246
Member Avatar for iamthesgt

Well something must be different. My first recommendation is to attach a debugger, and figure out what exactly is failing. My second recommendation is to get rid of system(), and use rename() and unlink(); if you insist on system(), at least spell out explicit paths to mv and rm.

Member Avatar for iamthesgt
0
230
Member Avatar for stakeMyHeart
Member Avatar for stakeMyHeart
0
119
Member Avatar for ret801
Member Avatar for ret801
0
111
Member Avatar for Stefano Mtangoo

Define a generic node type; somewhat akin to [CODE]typedef struct node_s { enum node_type_t node_type; void * node_specific_data; node_s ** children; } node_t;[/CODE] You may need other fields as well. Define "node constructors" for each language entity (terminals and nonterminals alike). In the semantic action for each rule, call a …

Member Avatar for Stefano Mtangoo
0
2K
Member Avatar for triumphost

[QUOTE]void not ignored as it ought to be[/QUOTE] because you are not passing the function to the thread. You are calling it (notice [ICODE]()[/ICODE] in [ICODE]FunctionToPass()[/ICODE] at line 21), then try to dereference the result (notice [ICODE]*[/ICODE] there). Since FunctionToPass is void, the compiler complains.

Member Avatar for nezachem
0
163
Member Avatar for gourav1

The code breaks the loop when ftell(p) returns -1. At what circumstances do you expect this to happen?

Member Avatar for gourav1
0
275
Member Avatar for capton

[QUOTE=tkud;1731613]That was not what I meant. In my own opinion, the OP meant that a user-defined function can run AFTER main() has ended, of which I try to explain that if main() has ended, the program has ended.[/QUOTE] Even that is wrong. Add a [CODE] ~foo() { std::cout << "Me …

Member Avatar for AceStryker
0
2K
Member Avatar for paulmcco

[QUOTE]a bunch of preceding syntax errors[/QUOTE] They are probably much more relevant. Start with the first one. PS: I bet you are missing a semicolon somewhere in one of your .h files.

Member Avatar for nezachem
0
437
Member Avatar for The 42nd

Why do you need test? Read directly to where you want it to be. Of course, you can also [ICODE]memcpy(name[i], test.name, sizeof(test.name))[/ICODE].

Member Avatar for asrockw7
0
2K
Member Avatar for shubham.joy

Newton-Raphson, of course. I expect you already implemented addition and division.

Member Avatar for Shardendu
0
157
Member Avatar for iPanda

[QUOTE]it says the the length of the string is 14h [CODE]src DB 'abcdefghi$' dst DB 10 dup(0) len DB EQU $-src[/CODE][/QUOTE] Yes, that's exactly what should happen. A $ sign at the line 3 is an assembly pointer, and its goal is to trace addresses at which the code is …

Member Avatar for dheaven
0
121
Member Avatar for asrockw7

Since the thread appears in the C forum, I can't recommend boost::asio (and I didn't). Depending on which platform you are targeting, you may look at the IO completion ports, WaitForMultipleObject(), [e]poll(), or select(). The latter is really the largest common denominator of all IO muxing techniques; it is somewhat …

Member Avatar for nezachem
0
155
Member Avatar for ben25x

[B]> But, when I try to define data in another line of code, I get cross-type errors.[/B] Can you show how you do it?

Member Avatar for ben25x
0
456
Member Avatar for Smartflight

The presence of flags, and special casing of certain conditions usually indicate that something is wrong. For example, on a very first insertion you compare temp with arr[0], which has a garbage value. If that comparison fail, the next comparison accesses arr[count], and count is -1. Welcome undefined behaviour. Looking …

Member Avatar for Smartflight
0
358
Member Avatar for manaila

Correct me if I am wrong, but for me [I]HTTP Version Not Supported[/I] means exactly what it says: HTTP version (1.1 in your case) is not supported. Try HTTP/1.0 instead.

Member Avatar for manaila
0
163
Member Avatar for newbie14
Member Avatar for newbie14
0
82
Member Avatar for coolfriends

The main loop should fill the array (not print it, but just fill) in the following manner: [CODE] K steps to the right K steps up increment K K steps left K steps down increment K [/CODE]Break the loop as soon as K reaches N. Of course, each step increments …

Member Avatar for 1qazxsw2
1
198
Member Avatar for nubcoder
Member Avatar for triumphost

There's a bunch of issues with the code. 1. An argument DevicePath of DisplayVolumePaths shadows the global DevicePath. 2. You are printing DevicePath[1] regardless of how many paths has been found. 3. Most important problem: DevicePath is populated with pointers to memory which is deleted at line 60.

Member Avatar for nezachem
0
142
Member Avatar for MaSSaSLaYeR

When your server starts sending a large file (line 195) it stops paying attention to incoming data, until the file is completely transmitted. Its incoming buffer fills up. After that, the client can't send anything and gets stuck at line 90. The server keeps sending. Client's buffer fills up. Now …

Member Avatar for MaSSaSLaYeR
0
170
Member Avatar for BenzZz

> i need to check there is at least one factor between the numbers before i call the gcd method on them. No. You need to fix the gcd code. Hint: any two numbers have a common factor 1.

Member Avatar for stevanity
0
3K
Member Avatar for carlucho

> for some reason the ReducedFraction function is not working Perhaps, because you never call it.

Member Avatar for thines01
0
311
Member Avatar for pato wlmc

Index, in fact. It's a long-standing math tradition. From math it was assumed by Fortran (which is Formula Translator), where anything starting with I, J, K, L, M and N was implicitly integer. Then it became a programming tradition.

Member Avatar for Tumlee
0
5K
Member Avatar for trantran

a) Yes b) C++ does not address this d) Sort of (due to e) e) Very much f) Start [URL="http://stackoverflow.com/questions/558848/can-i-force-cache-coherency-on-a-multicore-x86-cpu"]here[/URL], then try to apply those ideas to your architecture (if it is not x86).

Member Avatar for jmichae3
0
312
Member Avatar for coding101

What error are you getting? Replace line 24 with [CODE] printf("connect: %s\n", strerror(errno));[/CODE] Don't forget to #include <errno.h>

Member Avatar for nezachem
0
150
Member Avatar for abshah

The problem has nothing to do with 64 bit types. Values you read are not garbage, but a very valuable port definitions: [CODE]struct ofp_phy_port ports[0]; /* Port definitions. The number of ports is inferred from the length field in the header. */[/CODE] Which means, once you've [CODE]recv(connected, &features_rep, sizeof(features_rep), 0)[/CODE] …

Member Avatar for abshah
0
480
Member Avatar for valestrom

[URL="http://www.daniweb.com/software-development/cpp/threads/381899/1644654#post1644654"]Deja vu[/URL]?

Member Avatar for WaltP
0
151
Member Avatar for Dann0

You have to [I]call[/I] main somehow. Usually, it is [CODE]if __name__ == '__main__': main()[/CODE]

Member Avatar for Dann0
0
188
Member Avatar for wnr78ta

Think of the case of a list with 2 elements. Once you've deleted the last one, where does _first->_fore point to? BTW, same applies to _last->_fore in a general case.

Member Avatar for wnr78ta
0
718
Member Avatar for yurigagarin

You have to understand how fscanf works. Where does it store the result of conversion, and what does it return. In your case, all the numbers you read end up in [ICODE]input[/ICODE], while [ICODE]input1[][/ICODE] collects return codes (which all happen to be 1, indicating successful conversion of one field).

Member Avatar for yurigagarin
0
259
Member Avatar for ao_py

The problem is not so much equal condition (which is infinitesimal), but the fact that you recalculate random(). In the failing case, [CODE]## if random()*probA > random()*probB: ## scoreA = scoreA + 1 ## elif random()*probA < random()*probB: ## scoreB = scoreB + 1[/CODE] the fact that team A loses …

Member Avatar for Gribouillis
0
2K
Member Avatar for FinaL111

As usual, "doesn't seem to work" is not a helpful description of the problem. My wild guess is that you do not account for the newline character (which does appear in buff), and becomes an inherent part of certain words.

Member Avatar for WaltP
0
114

The End.