• Member Avatar for deceptikon
    deceptikon

    Replied To a Post in How to convert C++ to C?

    It's a C library, but also works for C++.
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in How to convert C++ to C?

    Provided your compiler supports the non-standard conio library, it'll work between C and C++.
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in How to convert C++ to C?

    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` …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in How to put simple Sleep c++ function togetther

    > I actually prefer seeing `int clocks_per_ms = CLOCKS_PER_SEC / 1000;` to `int clocks_per_ms = 1000;`. Me too. Too bad `CLOCKS_PER_SEC` isn't guaranteed to be 1000. ;)
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Need help with 2 collections through which to simulataneously iterate

    How do the indexes relate in those two join tables? Can you show me an example of what the data might look like?
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Need help with 2 collections through which to simulataneously iterate

    How exactly is your database structured?
  • Member Avatar for deceptikon
    deceptikon

    Undeleted a Post in What will be the best SEO technique for 2014

    I agree with you. To succeed in 2014, we need to refresh our classic model of seo stratgey; we need an edge that is recognized by the better inteligent Google. …
  • Member Avatar for deceptikon
    deceptikon

    Deleted a Post in What will be the best SEO technique for 2014

    I agree with you. To succeed in 2014, we need to refresh our classic model of seo stratgey; we need an edge that is recognized by the better inteligent Google. …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Please Help for this program

    Right now all it does is print out the numbers. I'm not going to write the whole thing for you, so try to finish up that last part. I assure …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Please Help for this program

    > ofstream myfile; // input file In what way does ofstream represent an input file? Take a look at my basic starting point example and work from there. You're reading …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Need help with 2 collections through which to simulataneously iterate

    I might organize my database so that I could do something like this: var presentation = from m in db.PresentationModules where m.PresentationId = pid orderby m.ModuleIndex select new { Module …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Please Help for this program

    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 …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Need help with 2 collections through which to simulataneously iterate

    I can think of several ways to do this, but more detail would help. What is this algorithm ultimately doing? Describing what you want to accomplish rather than *how* you …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in How to put simple Sleep c++ function togetther

    > The idea of this tutorial is to give people the idea how to write sleep on their own. just as you can be asked to write sort or other …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Data Type help

    You're trying to save a string into an image type, those two are incompatible. You need to extract a byte array of the image to pass to SQL.
  • Member Avatar for deceptikon
    deceptikon

    Edited Linked List String Seperation

    Hey everyone, I posted recently an issue that was almost resolved but I have a similar question but have different variables. I'm really new to C and I'm a bit …
  • Member Avatar for deceptikon
    deceptikon

    Gave Reputation to Builder_1 in using strtok function for counting the vowels in a string

    ancient dragon ur right but even by that way it does not gives the accurate count for vowels who repeat consecutively....well bad teacher is one aspect of deceptikon.....please help on …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in How to put simple Sleep c++ function togetther

    > There is no sleep function that is 100% accurate It really depends on what granularity you're looking for. More precise timing becomes more and more difficult, as you mentioned, …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in How to put simple Sleep c++ function togetther

    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 …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in error Keyword not supported: 'data base'.

    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 deceptikon
    deceptikon

    Replied To a Post in I am trying to make a program that writes a much larger program

    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, …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Happy 2014 :)

    2014: The usual evening, an inconvenient day off, and now I have to remember to write 2014 instead of 2013.
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Undefined behaviour accessing uninitialised data?

    > I don't mind indeterminate values at all if I access an array with no initial value. I just don't want my program crashing because of some undefined behaviour that …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Undefined behaviour accessing uninitialised data?

    > 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 …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in How to compare a vector to a map

    > is there a specific reason you used a struct for the weapon but a class for the adventurer? If it were a class, `Weapon` would need getters and setters …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Linked List Manipulating strings

    I'm still not seeing the issue. It should be a straightforward traversal of your list (assuming `it->def` is a `definition` instance as I showed in your other thread): printf("Input: "); …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Linked List Manipulating strings

    > because it doesn't help research the word since i'm getting only one strin Your example contradicts what you're saying. Each line in the dictionary is a single defintion (ie. …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Noob: setw() and right make absolutrely no sense (to me)

    > The first chunk below lines up the decimals, but my "$"'s are too far, the second one fixes that and then the decimals are all F'd. Right. The modifiers …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in How to compare a vector to a map

    How are the weapons stored? Are they always a string in display format? Because it would be easier to have a weapon class that separates these things and makes it …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Linked List Manipulating strings

    How was my previous answer to this question insufficient?
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Operating file

    Did you write the `remove_substring` function? My example won't compile without it.
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in want to know everything about barcode and QR code

    > i wanna know about what they represent ? There are a number of barcode symbologies that have different data restrictions. Here's a quick overview of some common ones: * …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in How can I access a specific protected inherited member depending on the cla

    > but my teacher said vectors allocate way too much memory and its bad to use so many of them in one program :( Sounds like premature optimization to me. …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Analyzing Part of a String

    Can you point out places where you want to split the sentence? That's where you start, and figure out how to do it programmatically. Conveniently enough, my example showed how …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in using strtok function for counting the vowels in a string

    > but my task was to do by using strtok() fn I love it when bad teachers ask you to do something with an approach that's woefully unsuited to it. …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Noob: setw() and right make absolutrely no sense (to me)

    > 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 …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Analyzing Part of a String

    > can you explain to me definition parsed_data? > what is it? Read the code from my first post.
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in using strtok function for counting the vowels in a string

    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 …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in How can I access a specific protected inherited member depending on the cla

    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 …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in what is the difference between string and cstring header files in C++

    > The strcmp() function compares the ASCII values of the characters one by one It compares the *numeric values* of the characters. It's not safe to assume that the character …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in what is the difference between string and cstring header files in C++

    It compares each character in turn. If they have the same numeric value, it moves to the next character. When a mismatch is found, it returns the difference of the …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in what is the difference between string and cstring header files in C++

    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++ …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Problem with my code looking for help

    `||` 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 …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Analyzing Part of a String

    Once again, this is just me, but I'd merge the two like this: struct node { definition parsed_data; struct node *previous; // Points to the previous node struct node *next; …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Operating file

    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 …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Analyzing Part of a String

    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 …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in Asus CM6870

    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 deceptikon
    deceptikon

    Replied To a Post in Windows Services Simplified

    > On re-read I'm guessing you perhaps thought this was outside the scope of the snippet? Good guess. The code was taken almost verbatim from one of my services, but …
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in strtok help

    Please post the *actual* string you're trying to parse.
  • Member Avatar for deceptikon
    deceptikon

    Replied To a Post in strtok help

    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 …

The End.