3,183 Posted Topics

Member Avatar for ~s.o.s~

I got my list from elsewhere but these are my fall likelies: * Strike the Blood * Yowamushi Pedal * Super Seisyun Brothers * Log Horizon * Meganebu? * Diabolik Lovers * Yuusha ni Narenakatta > Log Horizon (SAO knock-off or SAO done right? Let's bet...) Total knock-off, and everyone …

Member Avatar for ~s.o.s~
1
365
Member Avatar for Ahmed_43
Member Avatar for kissbudai.matyas
Member Avatar for jursnamo

That's an old dialect of C++ and doesn't use any difficult to convert features. You need to do three things: 1. Change `cin` to `scanf` function calls. 2. Change `cout` to `printf` function calls. 3. Add a `typedef` to your structure so that the `struct` keyord isn't required: typedef struct …

Member Avatar for Ancient Dragon
0
249
Member Avatar for richieking

For a quick and dirty sleep, that's fine (though not strictly portable). But note that a busy loop will consume vast CPU resources whereas a platform provided sleep typically puts the process/thread truly to sleep so that other processes can get a turn. The great differences in how an OS …

Member Avatar for deceptikon
0
2K
Member Avatar for andreas.petrou.967

What have you tried so far? And please don't say "I don't know how to start", because that's an extremely lame excuse. Anyone with a passing familiarity with C++ should be able to write this as a starting point: #include <fstream> #include <iostream> int main() { ifstream in("myfile.txt"); if (in) …

Member Avatar for andreas.petrou.967
0
125
Member Avatar for satys.sara

Just with `strtok` would be problematic. However, you can use `strtok` to split the string on `&` like this: A1.1*7.1 9.1 11.1/ Then manually parse each token to get the ranges. For example: char s[] = "A1.1*7.1&9.1&11.1/"; char *tok = strtok(s, "&"); while (tok != NULL) { char *sep = …

Member Avatar for Ancient Dragon
0
111
Member Avatar for Builder_1

Why not just keep it simple? int vowels = 0; int other = 0; for (int i = 0; myarray[i] != '\0'; i++) { switch (myarray[i]) { case 'a': case 'e': case 'i': case 'o': case 'u': ++vowels; break; default: ++other; break; } } cout << "Vowels: " << vowels …

Member Avatar for Builder_1
0
568
Member Avatar for yann.bohbot.9
Member Avatar for triumphost

> Why is accessing data in an uninitialised array undefined behaviour? It really depends on where the array is defined. If it's a local array then it's undefined behavior just as accessing an uninitialized variable is undefined behavior. The contents of the array are indeterminate, which is the "official" reason …

Member Avatar for mike_2000_17
0
193
Member Avatar for Wael1988

Please post your web.config file. Feel free to censor user names, server names, and passwords. It looks like the connection string is malformed for the information you've already provided.

Member Avatar for Wael1988
0
304
Member Avatar for gruntler

Two things: 1. String literals don't span lines. Provided there's nothing in between, you can make each line a string literal and they will be automatically concatenated onto one: fprintf(fp, "char out[8];char cur[8];" "char con[255, 255, 255, 255, 255, 255, 255, 255];\n" "if cur == con out == 0, 0, …

Member Avatar for gruntler
0
388
Member Avatar for mixelplik

> From what I understand set() creates a column that will hold something less than it's size, and << right or << left will justifiy it. Correct. But note that with the modifiers, typically they only affect the *next* item in the chain, not all further items.

Member Avatar for mixelplik
0
206
Member Avatar for jursnamo

Deleting and modifying a file's contents in-place can be tricky. The general recommended approach is to read the file, write to a temporary file with the appropriate changes, delete the original file, then rename the temporary. the benefit of this approach is that it's simple reading and conditional writing. For …

Member Avatar for deceptikon
0
308
Member Avatar for Damian_2

Why would every different shop have the same inventory? ;) But to answer your question, look into making the vector a static member of the base class. Then it will be shared across the board.

Member Avatar for Damian_2
0
239
Member Avatar for yann.bohbot.9

I'd start by breaking down the line into something more manageable: #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct definition { char *key; char *datestamp; char *value; } definition; definition parse_definition(const char *s) { char *copy = _strdup(s); // Make a copy for strtok char *tok = strtok(copy, "#"); definition …

Member Avatar for yann.bohbot.9
0
235
Member Avatar for Builder_1

The two headers are completely different. `cstring` is inherited from C and provides functions for working with C-style strings (arrays of char terminated by `'\0'`). `string` was born in C++ and defines the `std::string` class along with its non-member functions. `strcmp` works like this: int strcmp(const char *a, const char …

Member Avatar for Builder_1
0
7K
Member Avatar for tom.scott.73113

`||` has lower precedence than `&&`. To get the appropriate behavior (granted I'm assuming what behavior you want), you need parentheses: (gps == 'Y' || gps == 'y') && (childseat == 'N' || childseat == 'n')

Member Avatar for tom.scott.73113
0
134
Member Avatar for yann.bohbot.9

Consider a simple linked list [insertion sort](http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_sorting.aspx#insert). Instead of a direct comparison with relational operators, look at using `strcmp` on the `data` member instead and you'll be good to go.

Member Avatar for Ancient Dragon
0
237
Member Avatar for Ersin

It comes on a DVD. Just make sure that your BIOS is set to boot from CD/DVD and restart with the DVD in the drive.

Member Avatar for Reverend Jim
0
66
Member Avatar for deceptikon

In my job I tend to write a lot of Windows services. Due to this I've pared it down to bare essentials so that the code is as simple as possible, but still fully functional for the needs of each service. What this generally means is I *don't* use the …

Member Avatar for deceptikon
4
414
Member Avatar for glenn_boy13

> Hello, this would be my second time in posting a question which I solved by myself. Well done. Being able to solve your problems yourself is a great ability to cultivate. Unfortunately, a lot of people will ask a question and then stop working on it in the hope …

Member Avatar for deceptikon
0
537
Member Avatar for Labdabeta

[QUOTE]I need to know which of these three copies of code is considered best.[/QUOTE] const variables are preferred over macros because their names aren't lost during preprocessing. One of the biggest problems with macros is difficulty in debugging code where a macro is involved. Making const a compile time constant …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for <M/>

Go to your control panel, then enter `Control Panel\Appearance and Personalization\Display` into the address bar. Make sure the scaling level is set to 100%. When I upgraded to 8.1, it had it defaulted to 125% and your issue sounds like the one I was having.

Member Avatar for <M/>
0
159
Member Avatar for Reverend Jim
Member Avatar for abhijit_2
Member Avatar for deceptikon
-1
136
Member Avatar for Dani

> You're probably one of the most unpopular posters DW has ever had. I can think of a few that would vie for that title, but they gave up fairly quickly long before voting was introduced.

Member Avatar for stultuske
2
380
Member Avatar for abhijit_2
Member Avatar for Deep Modi

You may want to do some research on the OpenXML file format, it's not as simple as raw text. For something like this I'd look for a library that extracts Word files and then place the (hopefully) formatted text in my control. Aspose.Words is a good library for this that …

Member Avatar for deceptikon
0
337
Member Avatar for tiverton

> it's int main(), never void main() because main() always returns an integer back to the operating system. Except when the program is freestanding and not hosted by an operating system. But if you're writing a freestanding program, you're probably not asking for help on a place like Daniweb. ;)

Member Avatar for tiverton
0
264
Member Avatar for happygeek

Little do they know that we geeks don't let mere holidays keep us from Daniweb. ;)

Member Avatar for GrimJack
6
269
Member Avatar for Vasthor

> which would mean stable_sort would arrange those string with the same length in alphabetical order, is it? No, stable_sort would retain the *original order* of those strings with the same length.

Member Avatar for deceptikon
0
194
Member Avatar for SHE.RE
Member Avatar for ddanbe
0
102
Member Avatar for D8FMwyGG

"Help" does not mean "do it for me". Post your code, ask a real question, and stop appearing as if you're trying to cheat on your homework.

Member Avatar for deceptikon
-2
186
Member Avatar for Deep Modi

> What is the general way of changing the user account under which the application is running? The general way is to restart the application under elevated privileges: Private Sub ElevateMe() Dim proc As new ProcessStartInfo() proc.UseShellExecute = True proc.WorkingDirectory = Environment.CurrentDirectory proc.FileName = Application.ExecutablePath proc.Verb = "runas" Try Process.Start(proc) …

Member Avatar for Deep Modi
0
789
Member Avatar for hihamda
Member Avatar for dev90
0
391
Member Avatar for HiHe
Member Avatar for johans22

What you're asking is nonsensical. You want `var1` and `FUNC` to have file scope, yet still be visible in other files. Why? My guess is that you're confusing how `static` is overloaded and want semantics that are actually already there with `extern` functions and variables. It might help to explain …

Member Avatar for johans22
0
196
Member Avatar for overwraith

> My C/C++ classes swore by passing by reference as a good coding practice, and I have passed even primitive values by reference for a while now. Even in C++ it's a tradeoff. The size of a reference versus the size of the object being passed relative to the cost …

Member Avatar for overwraith
0
265
Member Avatar for Pia_1

You're opening your file in `"a+"` mode. This *doesn't* mean there's a read position and a write position. The file position is initially at the beginning of the file for reading, but the instant you do a write, the position is set to the end of the file. Subsequent reads …

Member Avatar for deceptikon
0
202
Member Avatar for mohammed.alaa.56808
Member Avatar for babbu

> If you have VS you can also connect to a database via the Data menu. Maybe I just have an old school mentality, but I've *never* handled database connections or data through the Visual Studio UI. I've always done it from straight code.

Member Avatar for Ketsuekiame
0
228
Member Avatar for BEAU_1

Sounds illegal or at least against someone's EULA. We don't allow discussions of that nature.

Member Avatar for aluya
0
98
Member Avatar for diaafayed

I'd recommend against that, actually. It makes managing the connection harder. Also, many database servers will support connection pooling to eliminate the performance cost of creating, opening, and closing a connection for each transaction.

Member Avatar for brite_a
0
230
Member Avatar for Dani

> It was more like, "Normally Daniweb users are able to help their users so why can't you help out like them"and so on... It wasn't like, "SO is #### so join Daniweb!" I can't see how *that* could go wrong, given the pissy tendencies of many SO regulars. :rolleyes:

Member Avatar for mike_2000_17
3
235
Member Avatar for muhammadnasiri

> `strcpy(ptr->name, s);` strcpy(ptr->name, s.c_str()); However, be very careful that the length of `s` doesn't exceed the bounds of `ptr->name`. The ideal (aside from using `std::string` for `name` in the first place) is to make `name` a pointer and allocate memory appropriately: node *ptr = new node; ptr->name = new …

Member Avatar for deceptikon
0
298
Member Avatar for Pia_1

> The problem is when I login, it would only read one record. That's exactly what you tell it to do. Technically, your file reading loop in `login` is pointless because the first iteration returns from the function in all cases. I suspect you intended to return 0 only if …

Member Avatar for dev90
0
198
Member Avatar for kent.johnstone_1

> My books show - and > but neither of them seem to apply. The books don't seem to show both together. Strange books. `->` is a single token, and should at the very least be mentioned in the precedence table for operators.

Member Avatar for kent.johnstone_1
1
246
Member Avatar for driazi

The reference is System.ComponentModel, `MarshalByValueComponent` is a class in the namespace.

Member Avatar for driazi
0
382
Member Avatar for Chrisadams

The End.