Posts
 
Reputation
Joined
Last Seen
Ranked #296
Strength to Increase Rep
+8
Strength to Decrease Rep
-2
88% Quality Score
Upvotes Received
38
Posts with Upvotes
32
Upvoting Members
26
Downvotes Received
4
Posts with Downvotes
4
Downvoting Members
4
17 Commented Posts
1 Endorsement
Ranked #858
Ranked #607
~102.83K People Reached
Interests
Everything
PC Specs
Obsolete
Favorite Tags
Member Avatar for Charlton21

Whenever I want to optimize a program, I usually start by trying to map the entire problem mathematically, simplify it, then re-code the simplified formula. I don't have time right now to look at your code, but maybe that bit of advice might help you.

Member Avatar for lernik
0
732
Member Avatar for pvbhargav

[QUOTE=cse.avinash]pleaser close this thread its too old(4 yrs) now.....[/QUOTE] Normally I would say the same thing, except that most of the "bump" comments were praising the information on this thread. While that isn't adding anything useful to this thread, it takes effort to browse Google, find this information, and feel …

Member Avatar for Sun_5
-1
14K
Member Avatar for yhh

Why don't you take the printScreen function out of MDAnalysis.c and move it into driver.c after the main function. It could fix your problem perhaps.

Member Avatar for Sean1234$
0
14K
Member Avatar for Rahul47

Setting global environment variables are OS specific, and are essentially managed by the OS itself. The OS is responsible for passing on the default environment values to new process spaces. Therefore you will want to refer to your Operating system's requirements. In [Windows](http://best-windows.vlaurie.com/environment-variables.html) it is stored in the system registry. …

Member Avatar for N1GHTS
0
217
Member Avatar for N1GHTS

Say I have code like this... typedef struct { unsigned A:1; unsigned B:1; } FlagStruct; extern FlagStruct *Flags; Imagine that the Flags instance is a shared resource in a multi-threaded application. Say thread #1 decides to read the value of Flags->A but thread #2 decides to set or clear Flag->B …

Member Avatar for N1GHTS
0
239
Member Avatar for zegarnek

You may be suprised how heavily used console interfaces are used in these modern times. I work with them and build them on a near daily basis in Linux for high end modern enterprise software. As much as I love building things from scratch, I also consider the value of …

Member Avatar for N1GHTS
1
3K
Member Avatar for pittdaniweb

Que: What is the exact difference between the "for" loop and "while" loop in C language ? Ans: About 20 lines of code. [I][B]Ba-dum-PSS![/B] *Insert laughter Here*[/I] [url]http://www.codingunit.com/c-tutorial-for-loop-while-loop-break-and-continue[/url]

Member Avatar for rajii93
0
808
Member Avatar for boomboombugsh

I looked up the word "plz" in the dictionary and it does not exist, especially not one with that many letter "Z"s. Note that the question in this thread has already been answered 2 years ago. Why can't you use that code as a starting point?

Member Avatar for iqra liaquat
0
223
Member Avatar for Rahul47

Just a quick word of advice. It is more efficient to use fwrite() or fputc() instead of fprintf() for writing characters to a file one at a time. This is because fprintf() needs to parse the format string whereas fwrite() and fputc() does not. This only matters if you plan …

Member Avatar for Rahul47
0
186
Member Avatar for symon_1

These instructions assume you want to read it to memory and that the letters are being converted into numbers of equal size (1 byte): 1. Open the file for reading 2. Create a string array large enough to store the contents of the file. 3. Iterate through each character of …

Member Avatar for Rahul47
0
237
Member Avatar for vibhu mishra

Note that system() returns a program status code. It is good practice to use this value for error handling.

Member Avatar for cgeier
0
341
Member Avatar for Rahul47

I believe Labdabeta answered the first question well. As for your second question you can technically do this... const *p = (const *)0x05; // Constant pointer address char *a = (char *)p; // Assign this address to a character array printf("%p", a); // View the address of the character array …

Member Avatar for Banfa
0
201
Member Avatar for Rahul47

Integer has nothing to do with pointer size. The pointer is the size of the memory address as dictated by the Operating System based on the CPU's capabilities. A 32 bit CPU will have a 4 byte address whereas a 64 bit CPU will have an 8 byte address. Some …

Member Avatar for Ancient Dragon
0
228
Member Avatar for H_beginner
Member Avatar for L7Sqr
0
245
Member Avatar for Rahul47

Its funny to think that c=(--a)+(--a); is not any more efficient than --a;--a;c=a+a; in terms of how it compiles. Its just that the first version is ambiguous in design as (--a) acts as a function with a side effect rather than as a variable in an algebraic formula. Ever since …

Member Avatar for N1GHTS
0
410
Member Avatar for shakin

I'd start over from scratch with this strategy: 1. Load the entire file into an array of strings. Create a new line for every newline character found. Don't bother with scanning it or doing anything else other than load those lines into memory. If you do this then it lessens …

Member Avatar for N1GHTS
0
257
Member Avatar for kristina.densmore

Pseudo code, Flow charts, etc are nothing more than a human legible medium to stage the logic so that it can then be translated into code. For instance you can translate this human readable line... **Ask the user for a floating point number** into this code... printf("Prompt: "); scanf("%f", &Variable); …

Member Avatar for cgeier
0
470
Member Avatar for shaneetra.graham

I'm curious if your shell is merely echoing commands to another shell. What does this shell do with the commands it receives? Are they translated into a system API or some library? Knowing this would help in deciding the best way to manage the command history.

Member Avatar for N1GHTS
0
126
Member Avatar for Van_1

I will disagree with Acient Dragon on this one. DOSBox runs native DOS games pretty well, so you have to ask youself "what am I doing differently than these other DOS programs"? I haven't programmed in DOS in forever so I can't say exactly whats wrong, but to just give …

Member Avatar for N1GHTS
0
401
Member Avatar for kent.johnstone_1

This is illegal unless you are working on an embedded system or a very low tech system that only works with 1 byte addresses: typedef BYTE SOCKET; And unless you are reinventing the wheel you should not be actually defining a typedef for SOCKET. Its defined in your socket library …

Member Avatar for kent.johnstone_1
0
317
Member Avatar for Renesme-LuCiFeR

I just want to add that DaniWeb has an often neglected "search" feature which you might find handy. I did a search just now for your question and found literally over 1,900 results! You should definately follow myk45's advice and learn the language grammar thouroughly before you embark on any …

Member Avatar for Ramesh.YoTLC
0
237
Member Avatar for N1GHTS

I am importing some C code into a C++ compiler, specifically Borland C++ Builder 5. I seem to have a problem with this style of code: // A structure that contain's itself typedef struct AnObject AnObject; struct AnObject { AnObject *Object; }; // A global structure to store a pointer …

Member Avatar for N1GHTS
0
240
Member Avatar for peter20

If you know any [URL="http://www.ubuntu.com/"]linux[/URL] scripting, you might be able to write a simple [URL="http://www.freeos.com/guides/lsst/"]batch script[/URL] utilizing the [URL="http://linux.about.com/library/cmd/blcmdl1_diff.htm"][B]diff utility[/B][/URL] which outputs the difference between two files. The [B]diff[/B] utility can ignore white spaces and non-typeable characters making it quite ideal for the job. You may write the script to …

Member Avatar for L7Sqr
0
297
Member Avatar for robinpurbia

There is no excuse not to say anything in a help forum. We are not robots: we don't communicate in code. If you are not comfortable with the English language, its okay. We will not criticise your speech. But you must explain yourself, otherwise you are just spamming the site.

Member Avatar for zeroliken
-1
108
Member Avatar for BITnur

Next time you post code, use the [ CODE ] Tags. The code you posted is terrible. Not only is it highly inefficient but the variable names are undescriptive and there are no comments anywhere to be found. Either way, the "count" variable is apparently used to store the number …

Member Avatar for BITnur
0
234
Member Avatar for engineer61

> [B]now three variables we printed to a file received from the user. This variable to another file, the user wants to take that file and the value of the variable is a variable, you need to do. And this event is the first change the variables in the file …

Member Avatar for zeroliken
0
136
Member Avatar for randolph.gamo
Member Avatar for randolph.gamo

If you have any specific questions from the book, you should ask them here. We would be happy to help you. It is not the nature of DaniWeb to give out answers, especially instructor's manuals.

Member Avatar for N1GHTS
0
110
Member Avatar for coding101

You could always use a library like [URL="http://www.libsdl.org/"]SDL[/URL] (its portable) and lets you capture the keystrokes and mouse of the computer without displaying anything.

Member Avatar for N1GHTS
0
97
Member Avatar for amit_as

[QUOTE=amit_as;1696555]how to find the position of a particular character in a given string in c[/QUOTE] Show an attempt at trying to do this yourself. It is more useful then just asking for the answer.

Member Avatar for nHulk
0
6K