3,183 Posted Topics

Member Avatar for parth2911
Member Avatar for alon4963

Here's an example that may help: #include <stdio.h> #include <stdlib.h> double uniform_deviate(int seed) { return seed * (1.0 / (RAND_MAX + 1.0)); } int main(void) { int lo = 3, hi = 50; for (int i = 0; i < 1000; i++) { double r = lo + uniform_deviate(rand()) * …

Member Avatar for deceptikon
0
200
Member Avatar for vampersie
Member Avatar for SpottyBlue

You need to include `<string>` for the string class, not `<string.h>`. The latter is for functions inherited from C.

Member Avatar for deceptikon
0
113
Member Avatar for ddanbe

1. Read the [documentation](http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.fileio.textfieldparser.aspx) 2. ??? 3. Profit I've written too many CSV parsers (*real* ones, not this naive comma split stuff) to be interested in doing it again. ;)

Member Avatar for deceptikon
0
3K
Member Avatar for sandesh.ps.9

Deploying a database can be tricky as well, even though it's straightforward to require that a database server be present for the application to work. In the past I've used three different deployment methods: 1. Build the database locally and provide a backup file that can be restored at the …

Member Avatar for deceptikon
0
302
Member Avatar for anuj_sharma

> I am so happy I've quit .Net because Java is really fun !!! :-) I'm happy that you're happy, but it's obvious that most of your bullet points for why Java is better are heavily opinionated to the point of propaganda. Some are off topic (eg. Tomcat being "better" …

Member Avatar for rumisa
0
343
Member Avatar for saja.omarii.7

> Guys .. u thought that I never tried .. I tried alot. Prove it. Not only does it show us that you're not just looking for a handout, but it also helps us to determine your level for tailoring help to you. Further, instead of a lot of back …

Member Avatar for Jamblaster
0
338
Member Avatar for mddv

> Main problem is that most of the links are nofollow now a days. Hmm, I wonder why that could be? :rolleyes:

Member Avatar for sweetdoll22
1
1K
Member Avatar for Warrens80

I wish you the best of luck, but strongly suspect that it won't end well one way or another.

Member Avatar for Warrens80
0
156
Member Avatar for Dearden

I'm curious, what's wrong with breast milk? Completely free, and arguably healthier in the long term.

Member Avatar for Ancient Dragon
0
844
Member Avatar for HiHe

I'd use public transportation if it were convenient and cheap for my area...but it's not. I'd ride my bicycle to work in a heartbeat...if it weren't a death trap. So I drive my car.

Member Avatar for pixelsoul
2
181
Member Avatar for kal_crazy

One of the reasons votes don't contribute to reputation is for the folks who have strong rep power to apply a mildly negative opinion without the risk of decimating another's rep. We could have implemented a way to choose how many point are applied, but that makes things more complicated …

Member Avatar for Warrens80
0
348
Member Avatar for castajiz_2

[This?](http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldataadapter(v=vs.110).aspx)

Member Avatar for Warrens80
0
152
Member Avatar for samuel terngu

That's MSSQL syntax. MySQL uses back ticks around column names instead of brackets: "INSERT INTO tblmysq(name,branch,sex,`dat`)VALUES...

Member Avatar for samuel terngu
0
354
Member Avatar for cambalinho
Member Avatar for Ikanda Simeon

Do you have an example of what you're having trouble converting? A sepcific case makes it easier to clarify things for you.

Member Avatar for L7Sqr
0
204
Member Avatar for Mafiamanandre

Two things to consider: 1. Make sure your project targets the full framework and not the client profile. 2. System.Web wasn't updated with .NET 3.5. You'll still find it in the 2.0 framework folders.

Member Avatar for Mafiamanandre
0
159
Member Avatar for inspire_all

`n` is typically represented as a collection of items being processed by the algorithm because that's easy to visualize. For example, if you have an array of 10 items, replace `n` with 10 for a specific calculation.

Member Avatar for amina.bm
0
145
Member Avatar for v.r.t

Allow me to ask the obvious question, why would you want to recursively read a file?

Member Avatar for vegaseat
0
158
Member Avatar for parth2911
Re: wifi

If you can connect to the web at all, it's completely open from the perspective of the Wi-Fi. Locking down access to specific pages or domains is the job of the firewall/router. To find out what's blacklisted or whitelisted, I think you would need administrative access to the firewall and …

Member Avatar for deceptikon
0
87
Member Avatar for christinetom

The best reference you can find in terms of details is [the standard](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf), but it takes time to learn how to read for maximum value.

Member Avatar for mike_2000_17
0
384
Member Avatar for reloadmvp

> Why would anyone put there self through this language Because sometimes it's necessary when you want bare metal control, architecture-specific optimizations, or absolute performance. From my own experience, hardware drivers and the deepest bowels of compiler/library implementations tend to use at least a little bit of inline or straight …

Member Avatar for turboscrew
0
129
Member Avatar for nhanduong

What exactly is meant by embedded C programs? I'd assume that you'll be *linking* with built C object code, but that may not be a safe assumption here.

Member Avatar for turboscrew
0
145
Member Avatar for harinath_2007

We've had an IRC channel for ages and ages, but nobody cared to use it even when it was linked directly on the forum. If you're interested it's irc.daniweb.com, channel #daniweb. But be warned, there's very little activity, so you'll no doubt find it boring there too. We're also looking …

Member Avatar for Dani
1
238
Member Avatar for ezra.kim.98

if (condition that evaluates to boolean) { // The condition was true } else { // The condition was false }

Member Avatar for deceptikon
0
122
Member Avatar for justair07

Pseudocode has no standard definition, just make something up. It could be as free form as: declare an array of 20 integers Or more rigid like an actual programming language: declare array(20) of integer

Member Avatar for justair07
0
7K
Member Avatar for ragnacrap

> Will this code work? No. That could easily be determined by trying to compile it. Let's remove the complication of functions for a moment and consider how to get the result you want. There are two issues: 1. "EMP" needs to be eliminated from the employee number result. 2. …

Member Avatar for ragnacrap
0
386
Member Avatar for joshl_1995

You have a number of options, but it depends what these programs are and do. Can you elaborate a little bit?

Member Avatar for joshl_1995
0
217
Member Avatar for cambalinho

The closest you can get without using the preprocessor is providing a default type: template <typename a = string> class test ... test<> a("hello");

Member Avatar for cambalinho
0
388
Member Avatar for Affable zaki
Member Avatar for deceptikon
0
102
Member Avatar for strRusty_gal

The actual error is that you're adding an unnecessary level of indirection in the tokenise call. tokens is already an array of pointers, there's no need for the address-of operator. However, that said you still have issues in the program. Most notable is the next line tries to print `tokens` …

Member Avatar for strRusty_gal
0
297
Member Avatar for sanjit.dasgupta2

> No programmer in his/her right mind would write that big of program without using functions to make it more readable. To be fair, it would be drastically shorter without all of the Turbo C++isms. ;)

Member Avatar for sanjit.dasgupta2
0
1K
Member Avatar for chdboy
Member Avatar for deceptikon
0
3K
Member Avatar for augustine.kumi.3

Good luck. Feel free to ask a specific question if you encounter any issues writing your program.

Member Avatar for deceptikon
0
96
Member Avatar for Pranshu_1

Could you post a small but complete program that exhibits the problem here? We're not generally keen on downloading things, and it makes it harder to eyeball the code quickly.

Member Avatar for deceptikon
0
198
Member Avatar for HunainHafeez

How about a different example? Let's say you have customers that have the option to enrole in a feedback survey. You want to get all of those customers to send survey emails. You could use `exists` to retrieve that list and exclude customers that didn't enrole. select c.ID, c.Name, c.Email …

Member Avatar for deceptikon
0
340
Member Avatar for smdjilani

To add to clife's explanantion, `#ifndef foo` is functionally identical to `#if !defined(foo)`.

Member Avatar for rubberman
0
139
Member Avatar for augustine.kumi.3
Re: code

> it gives me errors when i run them You didn't post any code or any errors. How do you expect someone to help you resolve them?

Member Avatar for mesut12
0
122
Member Avatar for strongard63

"Plain text" is ambiguous. You'd need to determine what text encoding method is used (eg. ASCII or UTF-8). Not all encodings will use a leading byte order mark to tell you what you have, so some trial and error may be necessary. If it's just assumed to be ASCII, a …

Member Avatar for ddanbe
0
203
Member Avatar for smdjilani

> Otherwise, I'm absolutely baffled that no error occured. It depends on the compiler. Modern compilers should error out if you don't properly cast the literal: int *ptr = (int*)12; I wouldn't be surprised if Turbo C allowed it without the cast. However, it's generally a bad idea to set …

Member Avatar for Ancient Dragon
0
171
Member Avatar for Ibitoye

Daniweb is more of a Q&A forum for pointed questions and discussion. It's not well suited for teaching someone from scratch. Might I suggest [Khan Academy](https://www.khanacademy.org/cs/programming)?

Member Avatar for alexstone
0
182
Member Avatar for cambalinho

> but why these number and not other? Magic numbers for bit twiddling are typically chosen to be unique bit patterns. For example, in the case of flags that are intended to be OR'd together you'd typically want to choose numbers where a single bit is set: 0x01 = 0000 …

Member Avatar for cambalinho
0
176
Member Avatar for akil77

> You'll understand that what I'm saying. While I understand what you're saying, I disagree. Learning the theory is indeed critical, but experience is equally critical. To gain experience, you need to work with data structures in an actual programming language. C is a good choice because it's low level …

Member Avatar for deceptikon
0
207
Member Avatar for cambalinho

You need to get the console text attributes before changing them, then reset them after you're done (either before or after setting the cursor position).

Member Avatar for cambalinho
0
220
Member Avatar for skyyadav

`cin` is in the `std` namespace. If you don't have a `using` statement somewhere to expose it, you need to qualify the name: `std::cin`.

Member Avatar for skyyadav
0
182
Member Avatar for Zain_2
Member Avatar for smdjilani

It should already behave this way. However, because the lifetime of the window is tied to the lifetime of your program, you have to keep the window open long enough to see results. For example: #include <stdio.h> int main(void) { puts("Hello, world!"); getchar(); // Pause for input return 0; } …

Member Avatar for rubberman
0
103
Member Avatar for mehdix

Looks fine to me. Though if you're not required to implement quicksort, I'd recommend simply using merge sort. Merge sort is better suited to linked lists because it [doesn't require random access](http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_sorting.aspx#merge). Quicksort on a linked list is tricky to implement efficiently due to the random access component, especially if …

Member Avatar for deceptikon
0
277
Member Avatar for johnrosswrock

> but i still want to know if it can be done Yup, it can be done. *How* depends somewhat on how you're deploying the setup.exe, but typically for standalone installers you can either use the default user interface, tweak the default user interface, or define your own completely. For …

Member Avatar for johnrosswrock
0
186

The End.