Programming :: Dynamic List With Different Type - C++

Jun 26, 2010

I'm quite new to c++ programming, so my concepts are not so increased yet...

I wanna to create a list to store my objects. I'll resume them here:

Code:

private:

And what I want to do is an event list:

Code:

Sometimes this works and sometimes I got "segmentation fault".

I think I'm doing it wrong, cause these objects have different sizes, so I don't know if I could have all of them in a single array.

View 8 Replies


ADVERTISEMENT

Programming :: Reading Lines To An Array And Generate Dynamic Zenity List?

May 18, 2011

explanation what I want to do exactly:I have a textfile which looks for instance like this:

file.txt:
...
something=else to do

[code]....

View 14 Replies View Related

Programming :: Get List Of Variables Of Particular Type ?

Jun 13, 2011

I have a C header file which have arrays of predefined(known) structure type. But i dont have names of arrays and their size. when i include that file and compile my application, i want to know the names and sizesof those arrays.

purpose of application is to get the content of those arrays and to explain it in descriptive words instead of hex numbers.ofcourse this can be done by file pointers and reading also with out header file inclusion, but as i am working in C, once compiled, those variables are in my address space in i include header file.

View 5 Replies View Related

Ubuntu Installation :: E - Type 'usage:' Is Not Known On Line 54 In Source List /etc/apt/sources.list

Jan 23, 2010

Ive seen some fixes for this but they all seem to be specific to the particular user's sources.list . . . ..

Code:

Here is Line 54

Code:

View 2 Replies View Related

Ubuntu Installation :: E: Type Sudo Is Not Known On Line 55 In Source List /etc/apt/sources.list

Mar 12, 2010

I tried to change the basic toolbar to cairo dock,a tutorial that i found told me to write in terminal gksu gedit /etc/apt/sources.list.d/winehq.listso i write it and a window opened,i couled not find the text that told me(the tutorial i mean)so i closed the window,after that i keep taiking the same error

E: Type �sudo� is not known on line 55 in source list /etc/apt/sources.list
E: The list of sources could not be read.
Go to the repository dialogue to correct the problem.
E: _cache->open() failed, please report.

now whene i got in the winehq.list the text has gone and i take this error in update manager,my software center doesn't work and my terminal whenever i type sudo commands says

E: Type �sudo� is not known on line 55 in source list /etc/apt/sources.list

View 9 Replies View Related

Ubuntu :: Error: E: Type 'sudo' Is Not Known On Line 52 In Source List /etc/apt/sources.list

May 4, 2011

don't know much, but when I tried to update I get this error:

E: Type 'sudo' is not known on line 52 in source list /etc/apt/sources.list E: The list of sources could not be read.

View 2 Replies View Related

Programming :: Error - Array Type Has Incomplete Element Type

Jan 26, 2010

I'm trying to compile a program and it gives me the following:

I checked cmath-util.h:46 and cmath-util.h:48:

I'm not a C person, and the author is unavailable so far.

View 5 Replies View Related

General :: List All Files By Type ?

Jun 22, 2010

How do I (in the command line) list all the .txt (or any common attribute) files in a directory?

View 4 Replies View Related

Ubuntu :: E: Type'2' Is Not Known On Line1 In Source.list

Sep 17, 2010

When I try to use Synaptic package manager I get the following message: E: Type'2' is not known on line1 in source.list E: the list of sources could not be read.to the repositary dialog to correct the problem.E:_cache-> open() failed, report.I cannot use Synaptic package manager or Update manager while this problem exists.

Dell inspiron 6400
ram: 2gb
hdd: 250gb
os: ubuntu 10.04
Tony044

View 1 Replies View Related

General :: Restricting Dynamic Ipaddress By Based On Dynamic DNS Host Names?

Dec 12, 2009

I want to restrict the Visitors to my Webserver whom i want to give access But the persons whom i want to give access. have Dynamic IP. I want to use DynDNS and update IP address of person. Based on the Hostname Pointing to Dynamic address of person.

View 5 Replies View Related

Ubuntu :: List All Files Of A Specific Extension (file Type)?

Jun 30, 2011

I want a list of all my mp3 files (or any other kind of file, actually) telling me HOW MANY OF THEM I have in my computer.I tried with both find and locate commands in terminal, but they don't tell me how many files I have.

View 2 Replies View Related

Programming :: C/C++ Dynamic String Array?

Mar 7, 2011

Can you create a dynamic string array and using calloc(),realloc()?
Like:

Code:
string* x;
x = (string) calloc(x,sizeof(string));

View 9 Replies View Related

Programming :: PHP And MySQL - Dynamic URL Generation

Jul 18, 2011

I have recently started PHP and mysql and so far I am loving it. I have read that the best way to learn any scripting/programming language is to read others code and get involve in a project. I am planning to develop a ticketing system for my intranet environment, meaning it will only be available to certain specific personnel to generate tickets, just like a helpdesk system. So a thought came in my mind, that, if a ticket is generated, a email should be sent to the relevant personnel pointing to that ticket. Now what I mean by this is, like if I have posted a query on LQ.org, a email notification is sent with a dynamic url pointing to my post if someone answers it. How its done? I mean is it done by PHP engine or apache?

View 2 Replies View Related

Programming :: Make A Dynamic Array In C?

Feb 12, 2010

I was thinking about how to make a dynamic array in C, and I thought that it would be much better if it could accept any data type. Is this possible? Of course I thought about void pointers, but how do I store the actual data?

View 7 Replies View Related

Programming :: List 4 Names From Users List And Output Them To Fbusers In Numbered Ascending Order?

Feb 2, 2010

How would I list 4 users ID numbered 10, 11, 12 and 13 from my users list and output them to a file busers where their names are numbered by ascending order? How would I accomplish that on a one line command?

View 4 Replies View Related

Programming :: Downloading A List Of Files From A Remote Server Using A List?

Feb 10, 2009

I am trying to get this script to work. The purpose is to download a list of modules from the slax.org the list consist of a list of module numbers. What I am trying to do is Download the file or the file name corresponding to the number in the list.the list is comma delimited. this is what I have done so far and I am a stand still.

#!/bin/sh
# Wget script to retrieve modules from slax.org modules
#
# ----Begin of user defined values -----
# Path to wget

[code].....

View 7 Replies View Related

Programming :: Convert The String Data Type To Other Primitive Data Type?

Mar 4, 2011

I am trying to generic way to convert the string datatype to other primitive data type. To achieve, i used Template . But i getting error and couldn't resolve the issue and error reported is also clueless.

Code
====
#include <vector>
#include <iostream>
#include <string>

[Code].....

View 7 Replies View Related

Programming :: Copy Files To Dynamic Directories?

Feb 14, 2011

I have been searching for a solution to the following problem:

When my distro of choice updates Firefox web browser, the directory name is '/usr/lib/firefox-<version>'.
The problem here is that the directory name is dynamic by nature and doesn't allow a simple static solution, e.g.
'cp -rf /usr/local/files/bookmarks.html /usr/lib/firefox/defaults/profile'.

The same quandary applies when adding extensions, changing prefs etc.
I have looked at the following commands:-
find, sed, xargs, grep, awk, fprint.
Unfortunately my grasp of syntax and programming is very simple at best.

View 2 Replies View Related

Programming :: (PHP) Dynamic Or Static Content Generation

May 12, 2011

My project looks like this:

Home
The Team [no-page]
-X
-Y
-Z
Projects [no-page]
-Coding [no-page]
--A
--B
--C
-Desing [no-page]
--E
--F
-Security [no-page]
--G
--H

Note: the Code/Design/Security projects pages (A,B,C,D...) will be at start around 35 pages, and will grow. My index.php is something like this:
PHP Code: .....

What I would like to know is how to build the content (the home-main.php)? Do it dynamically based on a link something like this index.php?page=coding_b, and put in the index.php page a number of 35 if/else statements to cover all the project pages or ... static, creating every page for the projects menu when I create the menu? I check if a page 'pro-co-a.php' exists, if not I create it based on some template and do the query to get the content from db or? How to organize the pages, if using static page?

View 5 Replies View Related

Programming :: Dynamic (kernel) Timer Never Is Started Again

Jan 26, 2010

My system: Ubuntu 2.6.31. Language C, compiler: gcc I am running dynamic timer as a kernel module and my issue is that the once the timer overflows, the program finishes. On the other hand i have forced to arm the timer again because of a while loop but the timer never is started again. i am targetting a periodic timer but it runs once and thats it.

[Code]...

View 1 Replies View Related

Programming :: C++ Dynamic Array Of Struc Doubt?

Nov 28, 2008

I'm studing and making my first real life program in C++. I've got a doubt related with including a string type into a struct when I'm managing memory allocationdynamically.Bellow I copy the test program I did which works ok. But if I try to use string type instead of "const char *" into the struct I receive a "segment violation" error when I run the program. No error messages when compilling it.Does anybody knows if I'm doing something wrong?

#include <iostream>
using namespace std;
struct Datos {

[code]...

View 4 Replies View Related

Programming :: Dynamic Memory Across Shared Libraries

Jun 1, 2009

Any good tutorial on sharing dynamically allocated objects across shared libraries in the same process and between shared libaries and main(). In particular, I need to know what creation and destruction sequences are valid when libraries are being loaded and unloaded. For example, is it valid to allocate an object from inside a shared library procedure, and then delete that pointer from a different module, especially in the case where the allocating module has already been unloaded.

I imagine there might be all kinds of problems with this. Although my preliminary tests seem to work most of the time, I get crashes from time to time, but I'm not sure if they're caused by memory management or by threading issues. I've been restructuring my code to use a global context object to manage object creation and destruction from main(), but I'd like to find a clear exposition of the specific issues I'm dealing with before I go too much further.

View 4 Replies View Related

Programming :: Implement A Dynamic Menu Which Will Allow To Specify An IP Address

Jul 2, 2010

I'd like to implement a dynamic menu which will allow me to specify an IP address and read it into memory. This is what I've got so far (it's fairly basic...)

Code:
IPS=`ifconfig -a | grep 'inet addr:' | awk '{print $2}' | tr -d "addr:"`
PS3='Select an option and press Enter: '
select i in $IPS
do
case $i in
$i) echo $IPS;;
esac
done
echo $IPS

At the moment it just says "Which IP would you like to use" and then freezes, most success I've had is it showing all the IP's listed in ifconfig and then showing the same menu.

View 4 Replies View Related

Programming :: Languages To Learn For Dynamic Website Design?

Nov 23, 2010

So a friend and I are new-ish to linux (I am reasonably comfortable with basic /etc text editing, command admin). We are, however, completely new to programming and (x)html. We have a few (what we think are) interesting ideas for dynamic websites.Ideally we would like to develop our own course of study to get to the point where we have a basic understanding of programming so that our adventures in the programming of a dynamic website would be possible. Much of what we need learn to do is the following: use daily updated public-domain data from several other sites, manipulate that data algorithmically, which would then yield updating output on our site. Here is what I would like to do:

1. learn the basics of programming with a language that would teach good code habits and fundamental understanding.
2. become comfortable with (x)html
3. learn another language for the extension of (x)html into a dynamic data-heavy website.

Question could you please suggest a way about going about 1>2>3?Ideally the language of (1) would be something that would not be "wasted" just on web design etc. As a language, C really appeals to me. However, if learning this wouldn't lend itself to being helpful in learning another language for webdesign maybe I shouldn't use it(?).If (1) weren't to be C, what language would be funadmental enough to teach good coding but also be helpful in learning (3)

View 14 Replies View Related

Programming :: Looking For Tools For Static / Dynamic Code Analysis

Sep 11, 2010

I am currently looking for tools for static/dynamic code analysis for embedded Linux system development (both device driver and user space apps). We will use Eclipse IDE and C++ lanuage. I hope the tools are easy-to-use, reliable, popular, better with good supports, and not-too-expensive. I already find a list of tools at WiKi, however, I don't have time to try them all. Could anyboy please recommend me a few? If you can tell me briefly about their pros and cons, that will be the bet.

View 1 Replies View Related

Programming :: Making Dynamic Memory As 64kB Aligned In C Lang?

Aug 17, 2010

I doing malloc and getting the chunk of dynamic memory. Now I want it to align that memory to 64KB. This means that the address of the memory starts from 64KB or multiple of 64KB.

View 3 Replies View Related

Programming :: C Coding Hacking / Ssh Dynamic Local Port Forwarding Implementation?

Feb 3, 2010

From this thread I've decided to try add a feature of removing local port forwardings in ssh.Here are some very ugly and not-yet working hacks what I made so far:

* Patch for channels.c
* Patch for channels.h
* Patch for clientloop.c

I was clearly expecting this to work without any troubles-everything seem to be logically correct, but I made a programming mistake somewhere: don't know where, maybe you will point me to this?Many sites say there is a WAY AROUND with -D param(starting socks proxy as a tunnel-generator), added since 5.2, but I don't need that way around. I need a way through. I use exact ports for exact services and if I want to change it runtime I'd like to have ability to do so.If you have other ideas or points instead of coding this, please share them here & here(original question).

View 2 Replies View Related

Programming :: Why The Thread Stack Size Cannot Be Changed When Calling In A Dynamic Library

Jan 5, 2011

Why the thread stack size can not be changed after calling pthread_attr_setstacksize & pthread_create in a dynamic library? Detail: I write a file thread_factory.c and plan to build it and produce a dynamic library (libthread_factory.so) In the thread_factory.c , there is a routine

[Code]....

And after this, there is application, it will call fct_thread_create(STACK_SIZE_256KB), and then call pthread_attr_getstacksize(), but the stack size return always be a fixed value 0xa01000. (I tried this on Fedora12) But if I build the application source code with the file thread_factory.c directly, the stack size return is right as my expect. I checked the source code of glibc about the routine pthread_create() as below:

[Code]....

View 7 Replies View Related

Ubuntu :: 'E:Type 'ntu-wine/ppa/ubuntu' Is Not Known On Line 1 In Source List /etc/apt/sources

Apr 11, 2011

I'm having a problem updating or even running the software center. Each time I open either of them, I get an error stating "'E:Type 'ntu-wine/ppa/ubuntu' is not known on line 1 in source list /etc/apt/sources.list.d/ubuntu-wine-ppa-natty.list'" and the update manager or software center closes. This has just been happening a few days ago and I would like a fix for it. I'm using 11.04 beta 1 and my WINE version is the latest development release. Anyone know how to fix this error? I tried unchecking my WINE PPAs in sources but that don't seem to do any good.

View 2 Replies View Related

Programming :: Active Forum / Mailing List For C Programming?

Apr 19, 2010

Just i want to ask doubts in c programming. I dont know whether this is the right place to ask doubts in c. If this is not a correct place, may i know where can i get help for c programming?is there any active forum or mailing list for c programming?

View 6 Replies View Related







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