Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1058585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:02:50+00:00 2026-05-16T18:02:50+00:00

I am working on a small script using the USB bindings for ruby. Since

  • 0

I am working on a small script using the USB bindings for ruby.

Since this is just a wrapper around libusb, all of C++’s features are visible through the abstraction, for example when usb_bulk_read requires giving a buffer as an argument (which would just be a pointer in C).

How can I create a buffer which is 64bytes long, for the following bit of code, without having to create a string with 64 spaces in coded into the program (which I am doing ATM). I wish ruby had pointers for this!

data =  "          "; /#etc. You get the idea
handle.usb_bulk_read(1, data, 0)

Where handle is a USB::DevHandle object which has already been opened.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T18:02:50+00:00Added an answer on May 16, 2026 at 6:02 pm

    Simple answer that probably avoids the core issue:

    data = ' ' * 64
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working through a small file upload script (learning experience) and I noticed that
I'm a LAMP guy and ended up working this small news module for an
Working on a small game using an HTML5 canvas, and javascript. And it's working
I am working on a small bit of script that will allow for easy
I'm working in a small PHP script that transform a SVG file into PDF
I'm working on a small banner-rotation script that loads a random banner from the
I created a small shell script which logs all of it's input to a
I'm working on a small GreaseMonkey script where I would like to embed a
I've got a small script that detects if the user is using a certain
I'm new to MVC3 and have been working on a small site using EF

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.