Programming :: C++: Not #including Files?

Jun 16, 2010

I'm trying to make my program as small as possible. Currently it's down to 17.8 KB, but I'd like to get it smaller (I know, I'm insane). Is there a way to not use the "#include" directive to include the entire header, but rather to just load only the stuff I need? For example, I just want to include 'sprintf' and 'printf' from stdio.h, not the entire header. Is this possible? Or am I misunderstanding some fundamental element here?

View 14 Replies


Programming :: Bash Code To Prevent Redundantly Including Files, Like Php's "include_once"?

Jul 13, 2010

I wrote some bash code to prevent redundantly including files, like php's "include_once". I've simplified it here so don't worry that it appears not to do anything:

Code: alias .='Include'
alias source='Include'
export __INC__functions=1


View 1 Replies View Related

General :: Possible To Delete All The Files Including System Files As Root?

Sep 21, 2010

If I am logged in as root in a linux system and I run command rm -rf on / folder, should it remove all the files? also the kernel?

View 4 Replies View Related

Programming :: Sum The Numbers Between And Including A And B?

Feb 11, 2010

write a script in bash or shell to add the numbers between and including two numbers

View 3 Replies View Related

Programming :: Including Headers Recursively - Is It Right?

Jul 29, 2010

Say, I have a header file containing all required includes:
Code: /* global.h */
#include <stdio.h>
#include <unistd.h>
#include <dirent.h>
#include <signal.h>
... /* and so on */

I have several modules in a program (*.h *.c files) and in each *.h I include global.h, then they are included in corresponding *.c files. And I receive strange messages from compiler, like a "warning: implicit declaration of function fdopendir", "error: expected declaration specifiers or '...' before 'siginfo_t' ", "error: 'DT_DIR' undeclared..." though these types, functions and constants are all declared in system headers. What does it mean?... Compiler is GCC 4.4.4-2, system is Fedora 13 x86_64

View 9 Replies View Related

Programming :: Including A Space Taken From String In A Var?

Jul 26, 2011

I have a tsv file that I'm trying to break down, line by line, then column by column so to speak. The file is a list of exported usernames, passwords, and display names from an email server, I need each separate to be used in other commands to provision the new server. My problem is, each display name contains a space, as usual with people's names. Here is the script for reference:


while read line
uname=`echo $line | awk '{ print $1 }' >> works`
pass=`echo $line | awk '{ print $2 }' >> works`


View 14 Replies View Related

Red Hat / Fedora :: Simple Backup HD Including All Files?

Feb 20, 2010

I am somewhat new to Linux and I am looking for a way to back up my HD with all my Linux files. I have a Toshiba laptop running Windows 7. The HD has been partitioned so that the computer can run Red Hat Scientific Linux. Using Grub I can dual boot to either Windows 7 or Linux on start up. I want a simple way of backing up the entire contents of my HD (both partitions - everything) - so that in the event of my laptop being damaged I can reconstruct my set up and data as before with all my files and settings in both Windows 7 and Linux intact. Is there a simple program that will enable me to copy everything to an external HD for back up. Can anyone recommend a package that will do this?

View 5 Replies View Related

Programming :: Compare Two Filenames Including The Paths?

Jun 22, 2011

I am trying to compare two filenames including the paths. Basically if two paths are similar then my program wants to display message. So I need to check for if two pathnames are same in the sorce and destination. So I was trying for the code to compare tow filename sincluding "" and if the Parent FIle Path is found in the child file path then I need to displays ome message. I was trying to modify something like this:

# Sample script


View 7 Replies View Related

General :: 'all Files' Switch For Grep - Including 'hidden'?

Jun 14, 2010

If I type 'grep alias .bashrc' a whole load of stuff comes up. However, if I type 'grep alias *' nothing comes up. Is there some switch for including 'hidden' files - like the -a switch for ls?

View 2 Replies View Related

Programming :: Compiling A C++ Program Including Libpq-fe.h Using Cygwin

Sep 16, 2010

Compiling a C++ program including libpq-fe.h by the command Code: g++ -I/usr/include -L/lib -lpq my_program.cpp for access to a PostgreSQL database results in the error Code: undefined reference to '_PQconnectdb'

View 4 Replies View Related

Programming :: Including User Defined Header File?

Apr 29, 2011

i got a sample.c which generate a linked list for sorting according to the number generated. then i want to split the sorting function into a header file. and it looks like the sort function in the header file could not access the linked list in the main. the error is dereferencing pointer to incomplete type



#include <stdio.h>
#include <stdlib.h>
#include <time.h>


View 2 Replies View Related

Programming :: Sed Strange Behaviour With Line Including Backslash?

Jul 1, 2010

I have a small script that takes input from one file, and uses this input to do a find/replace (with sed) to make an executable snmp trap.The input file could look something like this :JOHBURG SOUTH AFRICAOSLO NORWAY..etcThe script takes the input from this file, and preserves all words in one line as a variable (so that the variables are "JOHBURG SOUTH AFRICA" and "OSLO NORWAY", instead of JOHBURG, SOUTH, AFRICA, OSLO, NORWAY.This is working ok (in the given example, I get two variables).sed is supposed to take this variable, and use it to substitute "HITME" with the new variable.

cat tutticodes | while read LINE


View 21 Replies View Related

Ubuntu Servers :: Backup Including System Files - Boot From Live Cd?

Apr 22, 2010

I am researching how to make an effective backup on Ubuntu Server. This server will have Vsftp, VPN, Samba stuff , many other added packages +many printers, many users + data. I know I can use tar for the data /u no problem. 1. I was testing tar on the /home directory on a few user directories. I then created a new directory and did a restore of the users directories on it. I noticed the /home/user owner and group were root. The files in each directory remained the same. This gave me concern. If I had a crash and had to restore these to a new HD. I would have to change these, what else would I need to change? 2. Since I have many config files, how do I back up them? I know I can do a dump, but then users shouldn't be on the system. The system files will change as they add users, printers, etc, and asking users to not work, is not really an option while dump is running. I thought I could do a tar on whole system. (cron late at night .. not as many users) Then in event of crash of HD.

1. Boot from live cd
2. format the new drive
3. tar back in the whole system

Will this work right? Is there something I am missing?

View 3 Replies View Related

Ubuntu :: Uninstall (including Any Config Files) And Reinstall The Windows Manager

Jun 11, 2011

I've destroyed my desktop.

I'm using Ubuntu 11.04 and I would much like to uninstall (including any config files) and reinstall the windows manager.

Is there a set of commands I can run to achieve this?

View 1 Replies View Related

Programming :: Eedirect Stderr To File Including Name Of File With Error

Jul 26, 2010

It's kind of pointless imo for the types of errors that Exiv2 reports on to be written to a text file without some reference to the name of the file that prompted the error message in the first place. Is there a way to have bash identify the file that prompts the error and writes its name to the same file as the error (in my case, frencherrors.TX)?I've tried a painfully simple syntax that does something identical to a 2>&1 'suffix", namely 2 $file>>frencherrors.TX. It makes sense to me as written, but I'd like to know why I'm getting nothing on screen and everything directed to the file when what I want to see in the latter are the filenames causing the errors along with the text of the errors.

Is there another level one has to bore down into before they can garner this kind of output? If so, what is it and how does one invoke it in bash?

View 11 Replies View Related

Programming :: 'nm' Lists All Symbols - Including Static Library Symbols?

Apr 5, 2010

By issuing the 'nm' command on shared library (internally using one static library), the functions exposed by static library is also being listed, Which allows to use internal functions which is of course not intended. I have one static library having A(), B() and C() functions. Creating one shared library which has function XYS() that is using A() and B() functions from Static library. While doing 'nm' on shared library, all the static library function are being listed.

Static Lib:

void A(char *msg)


View 4 Replies View Related

Programming :: Command For Find/Replace In Text Files (inc. Files In Sub-folders)?

Oct 11, 2010

I found this command that works great finding and replacing a simple string to another in files located in that folder and all sub-folders.

Code: find . -name '*.php' | xargs perl -pi -e 's/OldText/NewText/g'

The problem I have is that I need to replace a more complex string, like this: Old string: /mnt/stor6-wc2-dfw1/627896/982574/ New string: /mnt/stor8-wc2-dfw1/369587/302589/ There I don't know how to do it... since the / is what separates the old from the new strings, and the strings that I want to replace have / in it. Also, I would like to know how to specify under what folder replace the files, for example, I want that it search/replaces all files under /var/www/mysite/htdocs folder.

View 1 Replies View Related

Programming :: Sort Files In Directories Based On Files Date

Sep 8, 2009

I need a script that will take all the files in a given directory and create new monthly sub-directories and sort all the files based on the creation date into the appropriate directory.For example, all files created between 01/01/09 and 01/31/09 will be placed in 'JAN-2009'

View 5 Replies View Related

Programming :: Convert RTF Files To MS Word Files Using Java?

Sep 19, 2010

In my application I came across a new requirement where I have to convert RTF files to Word and PDF formatted files. I am searching for an API using which my java application can able to convert the above specified formats.

View 4 Replies View Related

Programming :: Bash Programming - Rename Files In A Loop?

Mar 31, 2011

I need to rename the resulted searched files from a loopI have the following code:

find . -name DOC* | while read i
find $i -type f -name '*.txt'

basically, I am searching for all txt files inside any folder starting with DOC name.this code is working fine with me.I need to rename those .txt files to .txtOLDOS: Ubuntu 10.4Bash shell

View 10 Replies View Related

Programming :: C Header Files And Object Files ?

Sep 18, 2010

When is it good to use separate translation units and object files and link them into the main C program, and when is it good to include the header files in the main C program? I don't understand if most people include header files or if most people just link in object files and use their contents in the main program. It's sort of a simple question, but it's confusing to me and that's why I need help with it. I sort of don't understand the difference, or if there's really no difference other than the way the final result is achieved, which way is better or preferred, etc...

For example:




Simple explanation of the difference? or which one is preferred or better? I've read a little on the ELF format... so is there no difference in the end result? It's just a matter of preference or necessity, and where the information is to begin with?

View 9 Replies View Related

General :: Tar Directory And Then Remove Originals Including That?

Jan 17, 2010

I'm trying to tar a collection of files in a directory called 'my_directory' and remove the originals by using the command:

tar -cvf files.tar my_directory --remove-files

However it is only removing the individual files inside the directory and not the directory itself (which is what I specified in the command). What am I missing here?

View 3 Replies View Related

Ubuntu Multimedia :: Including BPM Analyzer To All ID3 Headers

Apr 28, 2010

I would like to include BPM data in all my id3 headers. I can do this one song at a time with banshee, but I have lots of songs, and it would take a very long time. In this thread I read about bmpdj and I am attempting to install this from source. I run into problems with the make command which gives me:

Link targets:
User Interface Resources:
[uic] ui-about.h
[uic] ui-album.h
[uic] ui-beatgraph.h
[uic] ui-bpmcounter.h
[uic] ui-bpmdj-pref.h
[uic] ui-bpmmerge.h
[uic] ui-capacity.h
[uic] ui-clustering.h
[uic] ui-freq-mapping.h
[uic] ui-importing.h .....
Source Files:
make[1]: *** No rule to make target `profile-clock.o', needed by `profile-clock'. Stop.
make: *** [.source-creator] Error 2

I don't know what profile-clock.o is, or what package provides it.

View 2 Replies View Related

Ubuntu :: Printscreen Without Including The Mouse Pointer?

Jul 8, 2010

I was trying to do a research about capturing the screen in Ubuntu Lucid where we can exclude the mouse pointer but to my dismay

View 5 Replies View Related

Ubuntu :: Make A 10.4 Image Including Upgrades?

Dec 30, 2010

Im using Ubuntu 10.4 LTS for quite some time now as my primary OS. Till this day i have done numerous upgrades to my system which were offered by Ubuntu community and some we personal needs/preference. I want to create an ISO file that would also have all the upgrades included in case something goes wrong with my computer hardware for instance hard drive failure. I dont want to start fresh from basic 10.4 LTS image and then by going through all the upgrades i have done so far, again.

View 7 Replies View Related

Ubuntu :: See A List Of All Users, Including System Ones

Apr 19, 2011

what I'm doing, but I'm implementing some automatic security protocols on a ubuntu system, and I need to see a list of all users, including system ones. The reason for this is that I created a system user with a specific UID, and I forgot it. The 'user' command only lists the nonsystem users.

View 3 Replies View Related

General :: Getting Package Size Including Dependencies?

Feb 10, 2010

I want to find out what is the size of a package including its' dependencies.


View 3 Replies View Related

General :: New Kernel Options To Consider - Including In The Build ?

Jun 27, 2010

I'm building the 2.6.34 kernel and I notice some interesting options, which you may want to consider including in the build, if you are building it:



View 3 Replies View Related

Server :: Create An IVR Including A PIN Verification System?

Nov 26, 2010

I have Asterisk 1.2 running on a SPARC Solaris machine with a number of extensions, queues and so on configured and working well. Recently I wanted to create an IVR including a PIN verification system, enabling a user to call the number, hear a message (welcome, enter your PIN, etc), enter his PIN in the DISA application and hear another message afterwards without any further input. I can call the extension (IVR), hear the message and input my PIN, though after that I'm left with a dialtone and Asterisk waiting for me to enter a number(extension to call). If I do this, it forwards me correctly, though I'd prefer an intermediate step including a message for the user.

User calls number.
User is greeted with 'Enter your PIN,etc'.
User enters PIN code, followed by a '#'.
User hears another message 'Thank you. Now you can...etc'.
User then provides further input, etc.

Here's an excerpt from my extensions.conf:


; Lights control
exten => 9994,1,Answer
exten => 9994,2,Playback(welcome)
exten => 9994,3,Playback(beep)


View 1 Replies View Related

Software :: Can Convert DVD To Avi File Including Subtitles?

Jul 15, 2010

Is there anyway i can convert a dvd to an avi file including subtitles?I watch a lot of burned DVD's, but my dvd player has an usb connection (plays avi's etc) so to spare empty dvd's i decided to buy a large usb stick and put the movies on it. But to do that, i have to convert the dvd's to avi's with subs.

View 4 Replies View Related

Copyrights 2005-15, All rights reserved