Search:

Type: Posts; User: Russell

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    1,298

    So I might as well use a class. Thanks.

    So I might as well use a class. Thanks.
  2. Replies
    3
    Views
    1,298

    Initializing a reference within a structure

    How does one initialize a reference within a structure?

    Example:


    struct _s {
    char& c;
    }
  3. I'll look into those. Thanks.

    I'll look into those. Thanks.
  4. Thanks for your input, all. It is a tricky one...

    Thanks for your input, all. It is a tricky one (at least for me).
  5. Since cbuffer is a byte array (i.e. it'll...

    Since cbuffer is a byte array (i.e. it'll containt null characters), stringstream cannot be used, as a null character terminates the stream.
  6. It's important to note that the cast must remain...

    It's important to note that the cast must remain unsigned, otherwise it'll overflow the characters. However, having the cast, as above, unsigned results in an error.
  7. Error: :!make 2>&1| tee /tmp/v748926/2 g++...

    Error:


    :!make 2>&1| tee /tmp/v748926/2
    g++ -O3 -Wall -pedantic -ansi -c main.cpp
    main.cpp: In function `int main()':
    main.cpp:9: error: conversion from `const unsigned char[4]'
    to...
  8. Convert `const unsigned char []' to `std::string'

    What is the best way to convert an `const unsigned char []' to `std::string'?

    example:


    const unsigned char cbuffer[]={0x61,0x62,0x63,0x0};
    std::string sbuffer=cbuffer; // error
  9. Replies
    9
    Views
    1,399

    It looks like std::string will work. Thanks for...

    It looks like std::string will work. Thanks for your input, ahluka.
  10. Replies
    9
    Views
    1,399

    The reason I don't want to use a string is...

    The reason I don't want to use a string is because the data is binary and may have null characters.
  11. Replies
    9
    Views
    1,399

    Array size referencing struct member

    Is it possible to do the following:


    136 struct s
    137 {
    138 int a;
    139 char b[a];
    140 };
  12. Thread: Need loop help

    by Russell
    Replies
    9
    Views
    1,183

    Also, when incrementing a variable, a+=.01 is...

    Also, when incrementing a variable, a+=.01 is suffice.
  13. Replies
    6
    Views
    1,498

    No, I didn't want to touch the original string....

    No, I didn't want to touch the original string. Thanks for your help.
  14. Replies
    6
    Views
    1,498

    Is there a way to terminate it at 'r' (i.e....

    Is there a way to terminate it at 'r' (i.e. "jar")?
  15. Replies
    6
    Views
    1,498

    Referencing part of an array.

    Is it possible to reference (or point to) part of an array? Example:



    char name[]={'b','j','a','r','n','e','\0',};
    char &jar=// 'j','a','r'
  16. Replies
    4
    Views
    2,236

    That's why you don't feed them. ;o)

    That's why you don't feed them. ;o)
  17. Replies
    4
    Views
    2,236

    Perhaps just a mere pat on the head. =)

    Perhaps just a mere pat on the head. =)
  18. Replies
    4
    Views
    3,039

    Well, that's a shame. I'll just use a for loop....

    Well, that's a shame. I'll just use a for loop. Thanks, Codeplug.
  19. Replies
    4
    Views
    2,236

    Every dog has his day.

    From the forum index:
  20. Replies
    4
    Views
    3,039

    for_each: callback function

    How do I get the for_each algorithm to use the objects function (line 17)?


    1 #include <iostream>
    2 #include <list>
    3
    4 class MyClass
    5 {
    6 public:
    ...
  21. Replies
    7
    Views
    1,872

    I understand. Thanks, CornedBee.

    I understand. Thanks, CornedBee.
  22. Replies
    7
    Views
    1,872

    Do you mean that what's in perimosDatabase.cpp...

    Do you mean that what's in perimosDatabase.cpp should be merged into perimosDatabase.hpp?
  23. Replies
    7
    Views
    1,872

    I not long ago worked out the problem was with...

    I not long ago worked out the problem was with the template, yet I'm still not quite sure what. Could you explain it some more please?
  24. Replies
    7
    Views
    1,872

    Sure it does: 3 template ...

    Sure it does:


    3 template<class T>
    4 perimos::database<T>::database()
    5 {
    6 }
    7 template<class T>
    8 perimos::database<T>::~database()
    9 {
  25. Replies
    7
    Views
    1,872

    Undefined Reference

    This problem has me absolutely stumped. As far as I can tell it's an include issue, but I don't know why.

    perimosMain.cpp


    1 #include "perimosDatabase.hpp"
    2
    3 class...
Results 1 to 25 of 73
Page 1 of 3 1 2 3