Programming :: Reverse A String Without Using Standard Library?

Sep 22, 2010

I am making a program to reverse a string

Code:
#include<stdio.h>
int main ()
{
int i,j;

[Code].....

View 5 Replies


ADVERTISEMENT

Programming :: Location Of - Gnu - C++ Standard Library

Jul 21, 2010

Where is the location of the header files for the c++ standard library?

I assume that they were installed by gnu g++, please correct me if i'm wrong.

I'm running ubuntu 10.04 with g++ 4.4.

I looked in /usr/lib/gcc/i486-linux-gnu/4.4/include, but this directory contains only the following:

Code:

Which doesnt seem to include the really basic things like iostream, for example.

Where can I take a look at the header files for these standard c++ libraries?

View 2 Replies View Related

Programming :: Finding A Open-source Unicode String Library For C++ (or C)?

Jan 3, 2011

Is there a good open-source Unicode string library for C++ (or C)?

View 4 Replies View Related

Programming :: Copy String A To String B And Change String B With Toupper() And Count The Chars?

Oct 22, 2010

copy string a to string b and change string b with toupper() and count the chars

View 3 Replies View Related

Ubuntu :: G++ And Gcc Can't Detect Standard Library Files

Jun 26, 2010

I was have installed gcc and g++ both 4.4.3 Version They were working fine, but now they suddenly seem to have lost track. Both cant detect standard library files. not even iostream ,fstream. (i have already tried the .h variant) my /usr/local/include/ directory is empty, should not something be there.

View 9 Replies View Related

General :: Using A Non-standard Library Path When Compiling Software?

Jan 10, 2010

I was wondering if there is an argument I can pass to the configuration file to have it use a library from a non-standard path to compile with - for example I would like it to use my perl located in /scratchbox/users/jeff91/usr/bin/perl instead of the standard /usr/bin/perl

View 3 Replies View Related

General :: Why Can't The System Import Modules From The Python Standard Library In Ubuntu

Jan 22, 2011

The whole day was more or less spent reinstalling a basic Gnome Ubuntu system. Everything went swimmingly until I started with the XBMC part of the installation. After wrestling with PPAs and apt-get for hours I finally got it installed, but then it all turned awkward in a hurry. It simply refused to start up. I clicked the icon and nothing happened for a good few seconds. The screen then flickered black for an instant, but after that nothing. I started from a terminal and it showed an error message saying it couldn't import Python's os and shutil modules. I found that mighty strange since both modules are part of the Python Standard Library.

Finally, in a bizarre twist, it turns out this doesn't seem to be a XBMC problem, suddenly apt-get started complaining too. TL,DR: I (nor the system) can't import any Standard Library modules in Python in Ubuntu! Is this a path problem? Or have I actually managed to uninstall some vital python packages, if so which ones? I am running Ubuntu 10.10, but I don't think this is necessarily a Ubuntu specific problem. Here are some dumps to show the error messages: (I forgot to copy the XBMC error message, but it looked exactly the same as these below, i.e., it couldn't import the os module) First from apt-get:

Code:

tv@tv:/usr/lib$ sudo apt-get autoremove
[sudo] password for tv:
Reading package lists... Done
Building dependency tree

[code]....

View 1 Replies View Related

General :: Update Standard Fedora Library Package Without Internet Access?

Apr 26, 2010

I need to get the libstdc++.so.5 library ( on a computer with Fedora 8 and don't wonder why it's so ancient,-there is a good reason for it) but I don't have Internet access from that computer, so I can't get to the online repo's.

However, I do still have the installation disk, and I'm typing this from a computer (SuSE 10) that is half a meter from the Fedora box.

I tried the "ADD/REMOVE Software" option on the menu, but it keeps on looking for the online repo and then if it doesn't get it, it fails.

Is it possible to get this library from the installation disk. How? Could I download the single package from the online repo onto the SuSE machine and then move it to the Fedora machine? How do I then tell the Fedora machine to "incorporate" it.

View 2 Replies View Related

Programming :: Pthread - Take String From The Command Line And Creates A Thread To Print The String

May 3, 2011

I've been trying to understand pthread in C a little better. So I made a simple program that takes in a string from the command line and creates a thread to print the string. I've looked online and copied the basic concepts but there are something things I'm confused about. The programs works just fine, but I have questions. Here's what I have so far.

[Code]....

One thing I'd like to know is why the 3rd argument in the pthread_create function which is my SendMessage function needs to be typecasted to a void pointer and then send the address of the function. Also as for the 4th argument, I would see typecasting to void pointer in some of the pthread examples I saw online, but in my case I'm passing a char pointer, would this be correct? In which case would I ever want to pass a void pointer?

Do I need a pthread_exit(NULL) in my main and in the SendMessage function? If so, why? I added the sleep() function so that I could let the pthread_exit function in my SendMessage function execute first. I simply saw that the online examples on pthread had pthread_exit() in both locations.

View 6 Replies View Related

Programming :: SDL Static Library - Shared Library ?

Apr 7, 2009

I'm reading about shared, static, and dynamic libraries. What is SDL? Is it static, shared, or dynamic?

I always thought a library would be a lot of .h and .cpp files compiled separately into .o files and then if you compiled your own program you could use the -l parameter to link the library and it was all compiled together. Now I'm not so sure.

I don't even see any SDL .cpp files in my system anywhere. All I have are lots of SDL .h files in /usr/include/SDL and I don't really understand the code in them.

I'm making a wild guess here: SDL is a shared library. SDL itself is NOT compiled into my program, therefore SDL must be on any system my program tries to run on. When I compile and link SDL all it needs is the header files to know what SDL function and objects it can use. And then on every system it uses an already compiled SDL shared library thingy somewhere.

So... where is that part of SDL? All I can find are header files.

I'm thinking the advantage of shared libraries is that someone could say update SDL on their own system and take advantage of the new features without having to download new executables with the new version of SDL compiled into them for every program that uses SDL.

So if I'm making an editor and a game engine and they both use a lot of the same .cpp and .h files that I wrote and I'm tired of updating one and then the other and I need to turn them into a library, then a shared library might be kind of a silly solution. I could just make a static library. Right? Because it's not SDL. Nobody else is ever going to use this library.

View 6 Replies View Related

Programming :: Using Sed Replace Line Containing Particular String By A Single String?

Oct 16, 2010

I have a set of lines as ahown below:

Leon went to school
Leon came back from school..
Leon had dinner...

I have to replace the line containing "dinner" by a single string LUNCH...

View 2 Replies View Related

Programming :: Creates String Suffixes Out Of A Reference String?

Feb 25, 2011

I need to creates string suffixes out of a Reference string. for eg. suffixes of abcdefg will be

1)bcdefg
2)cdefg
3)defg
and so on...

create an array of pointers to point to the first few characters and then use that pointer to print the rest of the string.But when i print using the pointer i get GARBAGE values! shudn't std::cout<<ptr[w] print the string following the char it is pointing to? why do i get garbage values?

View 9 Replies View Related

Programming :: C - Put A Specific Arbitrary Part Of A String Into It's Own String?

Apr 18, 2010

So if I'm given a location of a file like:

How can I just take the type of the file at the end? I know I can use strrchr() for a period to get the pointer to the period just before file type. Is there a build in string function that will just take the rest of the string from a certain point on forward in the string? I know it wouldn't be much work to make it myself, but I figured I would find out if it already existed before doing it.

View 9 Replies View Related

Programming :: Convert String To Integer Back To String C++ ?

Mar 13, 2010

Code:

The error is:

Code:

What I want to do is take input of ip4 as a string, convert it to an integer to add 1 to it, then reconvert it back to a string. Its not working.

My full code is:

Code:

View 1 Replies View Related

Programming :: Assigning Custom String To Std::string In C++?

Oct 12, 2009

I've been given a custom-made string class which handles string, wstring and bstr. It has a number of methods and assignment operators to convert to and from different types. The app I work on compiles happily in VS6 and VS2008, but when trying to compile in Redhat (version 4.1.1 in Redhat 5.0)

[code]....

View 4 Replies View Related

Programming :: How To Check If All Letters Of One String Are In Another String?

Nov 11, 2010

I have the following two type of strings1: A/D2: A/C/DI am trying to write a subroutine to check whether all of the letters in string 1 appears in string 2. If yes, return true. If not, return false. In the above example, all the letters (A and D) in string 1 are also present in string 2, so I return true.

View 4 Replies View Related

Programming :: Convert A Dynamic Library (filename.so) To A Static Library (filename.a)?

Nov 18, 2009

How can we convert a dynamic library (filename.so) to a static library (filename.a) using gnu gcc . Can we get a static library form a dynamic library . I saw a few post in which the conversion form a static library to a dynamic library is mentioned but, unfortunately, not the other way.

View 4 Replies View Related

Programming :: Reverse Dns Lookup In C?

Sep 27, 2009

Reverse dns lookup in C?

View 3 Replies View Related

Server :: Bind Reverse Zone : No Name With Reverse Lookup

Oct 12, 2009

I am using RHEL5. These are my config files:

Code:

options {
listen-on port 53 { 127.0.0.1; 192.168.14.54; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";

[code]....

View 3 Replies View Related

Programming :: Convert The Int To A String Using Stringstream Then Convert The String To A Char?

Mar 26, 2011

Do I have the convert the int to a string using stringstream then convert the string to a char? or is there a more direct way?Also is there a way to tell the length of a int?

View 5 Replies View Related

Programming :: Reverse Bit Order In MIPS/SPIM?

Apr 27, 2009

Here is what I have so far.The program receives and echos characters without syscalls. I am trying to add 2 procedures(rev7 and putint)Rev7: Reverses the least significant 7 bits and outputs $s2Putint: Prints the decimal value of $s2.When i run it, it echos the character then prints a "P". I have no idea where that comes from.Everything seems correct to me but I do not understand why it does not print the decimal digits

Code:
.data
hello:.asciiz "Enjoy This Program

[code]....

View 2 Replies View Related

Programming :: QListView - Way To Turn Off / Reverse Sorting?

Aug 23, 2010

QTreeView and QTableView have sort functions, but I need to sort a QListView, and for there to be no way for the user to turn off or reverse sorting.

View 11 Replies View Related

Programming :: C Function To Reverse The Byte Order In A Double?

Aug 12, 2010

I'm trying to write an extension to PHP which means coding in C. I'm really really rusty at C coding and was never very good at it.

Can anyone propose an efficient, safe, and [hopefully] future-proof way of reversing a double? Keep in mind that it should work on as many systems as possible and on 32- and 64-bit systems (and on ???-bit systems in the future?). Will the size of a 'double' ever change or will it always be 8 bytes?

I've tried this and it doesn't work...the compiler complains about "invalid operands to binary" because I'm trying bitwise shiftw on a non-integer.

Code:
x = (x>>56) |
((x<<40) & 0x00FF000000000000) |
((x<<24) & 0x0000FF0000000000) |
((x<<8) & 0x000000FF00000000) |

[Code]....

View 3 Replies View Related

Programming :: Programmatically Getting Standard File Dialog

Jul 14, 2010

Is it possible to do the following in C/C++ in Linux:Without direct linking (my program should NOT depend on Qt or GTK), display a GTK or Qt based file dialog.The behaviour should be something like this when my program runs, when you want to open a file:The program scans whether you have Qt installed. If so, it somehow manages to link itself to Qt (e.g. dynamically loading the .so file) and display its file dialog and get the path from it. If Qt wasn't found, it tries the same with GTK. If that also wasn't found, it displays a less powerful replacement dialog instead (better than nothing).

Or is there any other simple way in Linux to get a standard file dialog somehow (similar to when compiling for Windows you can very easily get its standard file dialog, no matter what version of Windows, in your code, even if your program doesn't use any other Windows GUI at all).

View 4 Replies View Related

Programming :: Awk Syntax For Calculating Average And Standard Deviation

Apr 20, 2011

I have a data in a column.

Code:

I want to calculate average and standard deviation. As first step I want to calculate average for the data than calculate (del=data - avg) for all the data.

I suppose get

Code:

For this I use AWK and the code goes like this

Code:

But I get different answers.

Code:

Why the answers are so different? since this is wrong I can not continue calculating the standard deviation.

View 6 Replies View Related

Programming :: Direct Standard Output From Find Command?

Mar 26, 2010

I'm trying to pull out sections from a bunch of files. For one file, I use:

Code:
sed '/string1/,/string2/ !d' <filename.ext >newfilename.ext
to pull out everything between two strings in the original file and put them in a new file.

[code]....

View 3 Replies View Related

Programming :: Related To Pthreads And Timers In POSIX Standard

Feb 17, 2010

I have created two threads:
Thread 1 and thread 2

In the main thread, i have put up a timer which generates a signal periodically when it expires, which reults in execution going to signal catcher function.when this function is invoked, under certain condition it goes to thread 1 and under another condition it goes to thread 2. The problem lies here that when it goes to thread2,i have a loop to process but it doesnt come out of the loop and hence from thread2, even though timer has expired.

View 2 Replies View Related

Programming :: Standard For Naming Convention Of Commandline Options

Feb 22, 2011

Is there any document or specification like the Linux Standard Base for the naming convention of commandline options?

View 3 Replies View Related

Programming :: Timeout For Standard Input Using Tcsetattr Not Working?

Jan 5, 2010

The code is attached..My intention is that getchar which usually blocks,should come out after 5 seconds(VTIME).But this is not happening..can anyone tell me the mistake that I make..?

#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>

[code]...

View 3 Replies View Related

Programming :: Underscores In Standard Functions, An Example Section From Cat.c Is Included

Sep 4, 2010

From cat.c in GNU coreutils:

Code:
void
usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.

[Code]...

I don't remember ever seeing this in any examples I've ever seen, so I'm sure I've never seen an explanation of this.

View 1 Replies View Related







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