General :: Use Pointer To An Array Of Pointers On CPP?

Jun 15, 2010

I'm trying to list some information of my database. To do that I'm using a class(MyClassDao) that will do all the SQL stuff and returns to me a list of objects with the content of my table (each row = one object). The problem is: my list gets only the first object... on the second index I'm getting 'segfault'.Can someone post something to help me (link, reference or example)?The call for the list function is:

Code:
MyClassDao* mcd = new MyClassDao();
MyClass** myClassList;

[code]...

View 2 Replies


ADVERTISEMENT

Programming :: Pointer To Array Of Integers?

Aug 23, 2009

Code:
#include <stdio.h>
int main ()

[code]...

View 7 Replies View Related

Programming :: Pointer Vs Array Declaration?

Jul 26, 2010

Whats the practical diffrens between these declarations in c?

char *a_str = "hello";
char a_str[] = "hello";

View 4 Replies View Related

Programming :: Arrays In The C Programming Language Are Pointers To The First Element Of The Array?

Mar 27, 2010

I wonder why arrays in the C programming language are pointers to the first element of the array, not the first element of the array itself?

View 14 Replies View Related

Programming :: C++ Find Size Of Array, Through Pointer?

Mar 10, 2009

i am trying to find the size of an array, not by using the array as a parameter to "sizeof", but by using a pointer -pointing to the array- as a parameter. How do i do this?I use a 32-bit PC.Here's:

Code:
#include <string>
#include <iostream>

[code]...

View 2 Replies View Related

Programming :: C String As An Array Of Chars And As A Pointer To Char?

May 13, 2009

Please look at the comments

Code:
/*
* TEST CASE TO CHECK DIFFERENCES BETWEEN STRING AS

[code]...

View 14 Replies View Related

Programming :: Point A Char Pointer To A Part Of Another Char Array?

Nov 4, 2010

Programming in C.I have two char arrays.char buf1[1024];char buf2[1024];Aren't buf1 and buf2 also pointers?I read in 1024 bytes into buf1 which contain about 300 bytes of characters with newlines. The data is basically a few English sentences. I'm trying to scan buf1 for newlines and then stop at the 1st newline and copy the rest of the data from that 1st newline into buf2.So I run a for loop to look for that new line.

Code:
for(i=0; i<1024;i++) {
if((strcmp(&buf1[i], "

[code]...

View 8 Replies View Related

General :: Convert Full-disk RAID5 Array To Partition-based Array?

Dec 23, 2010

I have a RAID 5 array, md0, with three full-disk (non-partitioned) members, sdb, sdc, and sdd. My computer will hang during the AHCI BIOS if AHCI is enabled instead of IDE, if these drives are plugged in. I believe it may be because I'm using the whole disk, and the AHCI BIOS expects an MBR to be on the drive (I don't know why it would care).

Is there a way to convert the array to use members sdb1, sdc1 and sdd1, partitioned MBR with 0xFD RAID partitions?

View 1 Replies View Related

General :: Bash: Calculating In Array And Storing Result In Array?

Dec 2, 2010

I have an array called arrayini which stores numbers. I want to take log to the base 2 of each of the numbers in that array and put it in file called result. I've used the following code to do it.

Code:

size=${#arrayini[@]}
for ((i=0;i<size;i++))
do
echo "scale = 12; l(${arrayini[$i]})/l(2)" | bc -l
done >result

It works fine but its taking pretty long to calculate since I've got about 230,000 items in the array. So I decided to store the result into an array hoping that it'd be faster. I tried the following code. arrayresult is where I try and store the result. The code doesn't work because of the second last line.

Code:

unset arrayresult
size=${#arrayini[@]}
for ((i=0;i<size;i++))
do
arrayresult[$i]="scale = 12; l(${arrayini[$i]})/l(2)" | bc -l
done >FILE2

There is a syntax error clearly.

View 6 Replies View Related

General :: Mount USB Drive - Device Pointers Static?

Jun 6, 2011

I'm using an external USB drive to perform system backups. The script I'm using has a mount command - mount /dev/sdcx /systembak, it works fine until the external drive is mounted into a different USB port which causes the device path to change and the script needs to be modified to reflect that change. Looking in the /dev/disk/ directory I see ./by-id ./by-label ./by-path ./by-uuid. I've been able to mount the disk using one of the device pointers in those directories; are any of those device pointers static or do they change every time the USB disk is plugged into a different USB port.

OS: RHEL/CentOS

View 4 Replies View Related

General :: Some Pointers Required For Configuration Of MySQL On RHEL

Feb 8, 2010

I am new to mysql can some one provide me the documentation or some recommended links to start the configuration of mysql server on RHEL. Also if I get the database schema, how can I replicate the same in my machine. Any documentation for this?

View 8 Replies View Related

Programming :: Pointer To Pointer Segmentation Fault?

Jun 27, 2009

I have been googling trying to fix this ... basicly I have a (int **) variable, and when I try to pass a (int) value to a specific position, I have seg.fault.Resuming what I have is:

int ** p;
p[0][0] = 1; //segmentation fault

View 7 Replies View Related

Software :: Bash - Indirect Array Reference To Array With Values Containing Spaces?

Jun 4, 2010

This _almost_ works. I just can't quite get it to honor the spaces.

Code:

#!/bin/bash
profiles=(
PROFILE_ONE
)
PROFILE_ONE=(setting1 "setting number 2")

[code].....

View 9 Replies View Related

Ubuntu Servers :: Creation Of RAID-0 Array In Disk Utility Resulting In Smaller Than Expected Array?

Sep 27, 2010

I have a NETGEAR ReadyNAS NV+ with four 1TB drives in a RAID-5 array. This is our primary file storage. This has previously been backed up to a hardware RAID-0 array directly attached to our Windows server. The capacity of this backup array is no longer sufficient. So the plan was, take a bunch of 200GB to 320GB drives (And a 750) I had kicking around, chuck them in a couple of old SCSI drive enclosures I have collecting dust, attach them via IDA/SATA-to-USB adaptors to a USB hub, attach that to the server, create a JBOD array spanning the disks, and back up the NAS to that. Performance is not an issue as this is just to be used for backup, with the idea being as near to zero cost as possible (Spend so far = NZ$100�ish).

The first hurdle I struck was Windows not supporting Dynamic Disks on USB drives (Required to create a spanned volume). At first I resisted using another machine (i.e. a machine running Ubuntu) as I didn't want to dedicate a piece of hardware to backing up the NAS. I then decided it would be acceptable to do this via a VM, which is what I've done.So I have 10.04 running under VMWare Server 2.0.2 under Windows Server 2008 R2. The disks are all presented to the VM. I wasn't sure if I was going to end up creating the array under LVM or something else, but I noticed Disk Utility has an option to create an array, so I tried that. When I add two 250GB drives, the array size is 500GB. When I then add a 160GB drive, the array size drops to 480GB. Huh? If I keep adding disks (Regardless of order) the final array size comes out at 1.8 TB, as per the attached screenshot. Now with the following drives, I expected something more like:

160 + 250 + 250+ 750 + 250 +200 + 200 + 250 + 320 + 250 + 320 = 3.2TB

Am I missing something or making a false assumption somewhere?

View 4 Replies View Related

Programming :: C Realloc Resize Array / Delete And Add Information Into The Array?

Mar 6, 2011

I am trying to dynamically delete and add information into the array "blah"

Code:
int blahsize = 1;
char** blah = (char**) calloc(blahsize+1,sizeof(char*));
Adding information:
Code:
blah[1]=stuff1;
blah[2]=stuff2;
code....

View 2 Replies View Related

Programming :: Convert Short Array To Char Array?

Jun 7, 2010

I have trouble converting a short array to a char array

Code:

short pShort[4] = { 0x41, 0x42, 0x43, 0x44 };

How to convert this to a char array?

View 4 Replies View Related

General :: Moving Pointer Without Using Mouse?

Apr 2, 2010

How can I move the mouse pointer on Linux without actually moving the mouse?

View 2 Replies View Related

Programming :: Converting A PHP Array Into An HTML Array?

Aug 9, 2009

I'm writing a PHP program. I've encountered a problem; in the following code I try to pass $_POST['delete'] which is an array as the value of a hidden input to some form, but it doesn't do so.there's something wrong with converting PHP array into HTML array. I'm sure that $_POST['delete'] is not null and is a real array.

echo '<input type="hidden" name="delete[]" value="'.$_POST['delete'].'" />';

View 4 Replies View Related

General :: Possible To Steer Mouse Pointer By Keyboard?

Nov 23, 2010

Is it possible to steer mouse pointer by keyboard.

View 2 Replies View Related

General :: Warning In C About Comparision Between Pointer And Interger?

May 18, 2010

i got a warning saying that comparision between pointer and interger

#include<stdio.h>
#include<string.h>
main()

[code]...

View 2 Replies View Related

Ubuntu :: Get X11 Mouse Pointers Working?

Jun 10, 2010

I've been facing this problem since months before I decided to find an answer. I downloaded a cursor theme from gnome-look.org and then installed it by dragging the tarball to the themes window. It said theme is installed. But the effects are not visible yet. I then shoot up firefox to see the new pointer working but not outside firefox. I even noticed the new pointer theme works in nautilus for all except pointing (it works while resizing, selecting text, loading but not the regular pointing).

I searched the forums and found a similar problem: [URL]

the solution doesn't work because there is no "cursor theme" option in ccsm. i've attached a screenshot too.

Is it a bug? do i need to disable compiz to "have my own desktop"? Is there a solution?

View 5 Replies View Related

Ubuntu :: Pointers On Using Old Xorg With Maverick?

Dec 15, 2010

I need to use fglrx as later don't support TecraS1 chipset and ati driver is unable for FS flash playback.The required ati fglrx only works with Dapper 6.06 LTS but not with new newer releases with newer xorg. someone fix me on this. If I remember maverick xorg I lose all the ubuntu screen candy, right? If I compile xorg7.0 with Maverick I guess I could get it to work, but what about getting Ubuntu Gnome desktop instead of plain out-of-the-box xorg?

View 6 Replies View Related

Ubuntu :: Pointers To Learning Scripting?

Apr 25, 2011

I have a project for my computer class, and I was a bit ambitious with my ideas and am wondering if I made a smart choice. I need to learn sooner or later anyway! I'm a beginner when it comes to scripting but I'd like to learn more advanced stuff. When I say basic I really mean basic among all basic. To give you an idea I only know some simple HTML and Python. The idea I proposed for my project goes as follows:

The challenge we were given is to create a spreadsheet of data from a website given to us. Points are given for creativity and simplicity in how we go about doing this.After taking a look at the site (or rather, html files given to us), and with having dabbled with Python before, I came up with what I thought was a pretty good idea.The pages of the "site" are just numbers. They go from 001-117 .html in terms of filenames. Their source code has some sort of table set up, and the information we are pulling off are easily found by the tags that precede them (the info, btw are the periodic elements).

The tags are pretty obvious, and state pretty much what they are labeling. My python knowledge is almost nonexistent but I figured that would be something Python would be capable of. Why do I post this here? I'm relatively new to Ubuntu too but keep hearing about bash scripts and such. Would this be even better? (Perhaps it's silly but I'd like to use Ubuntu to accomplish this)

Or is there an even better scripting method/language I should be using? Could anyone give me some pointers in how I could accomplish this? I'm really hoping to learn a lot from my first "real" scripting experience!

View 4 Replies View Related

Programming :: C With Gcc: Are All Variables Defined Like Pointers

Sep 13, 2010

i'm practicing in very basic c programs using the gcc compiler.I found that when i create two variables let's say

Code:

int a,b and Code: a=15;
b=3;
a=b;
b--;

then a equals 2.I thought that this isn't normal in C isn't it?I haven't had the time to read the gcc documentation yet...so i think it has something to do with my compiler's default settings.I use the

Code: gcc filename.c -o filename command to compile

Are all variables defined like pointers?

View 5 Replies View Related

Programming :: C - Segfault During Malloc. How To Use The Pointers

Mar 23, 2010

So the place where I'm having a problem is here:

Code:
typedef struct {
void **Mem_Chunk;

[code]...

View 10 Replies View Related

Programming :: Difference Between Two Arithmetic Pointers

Jun 1, 2010

What is the difference between *ptr++ and (*ptr)++. In my opinion the terminology is all over the place so if you could give an example it would be better.

View 8 Replies View Related

General :: Can Distros Activity-monitor/ Pointer Be Changed

Dec 6, 2010

Fedora 13 is currently my Linux Distro of choice but I find the Pointer/Activity-monitor is annoying. Usually it has two states ,the solitary round thing or the pointer. Every now and again they are combined into the Ubuntu combination symbol of the two joined into one image. Is there a way to change this image/moving-icon? I like Mandriva's the best and would prefer it worked on all Browser windows so that New Firefox versions did not disable it.Thanks in advance!

The term I needed to find additional info was (Mouse Themes). The (Wait Cursor) is usually included with this.Download the theme you want and go to System> Preferences> Appearance> Customize> Pointers to change to one that is alreadly installed.To install themes, System> Preferences> Appearances> Install. Apparently more than one them can be used on a distro so the Browsers will use its own while Nautilus will use another. Fedora's default one does not funtion properly. It will not change to the pointer if a web page is still loading if you need to sellect something. I learned that Mandriva uses the (Bluecurve) variation for default which is like Ubuntus where it does not have to change between two different images and hense does not lose functionallity.

View 1 Replies View Related

Fedora Installation :: Get Around Or Work With SELinux Any Pointers?

Mar 22, 2009

I am trying to install MyEclipse on FC10. But, I am getting an SELinux alert saying that myeclipse is attempting to move/change a file - Thus I can't seem to get it installed.

I have NO idea how to get around or work with SELinux any pointers.

View 2 Replies View Related

Ubuntu :: Custom Mouse Pointers Appear Only In Certain Places?

Oct 18, 2010

Running 10.04 64-bit. After installing any custom mouse pointers the new pointers only appear when the pointer is in the main "body" of a window. When in the menu bar, title bar, and some other peripheral areas of the window the pointer changes back to the default. Custom pointers are not displayed at all on the desktop or in the panels. Very strange.

View 2 Replies View Related

Programming :: Function Pointers To Class Members Cpp

May 23, 2010

i'm a bit stuck playing with the following class setup for glut. The actual issue is with the function pointers.Basically the following code is the opengl redbook cube example slightly modified.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved