473,586 Members | 2,854 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to insert a string in side other string

3 New Member
Hi, this is my first post and i dont have a very good english so I'll try to do my best....

I'm working with image processing in C++, for that I read the file name from console , I open the file I work with it and then I want to create a file with the same name of the image with a "_res" added....

so for example if the image name is "image1.bmp " what i want to save is "image1_res.bmp ".... but when I'm working with te string for same reason i can only get staff like this... "image1@*$_res. bmp".

For opening the image and saving it im using a open source libery. : FreeImage.

This is what im doing....:

Expand|Select|Wrap|Line Numbers
  1.      char *input_dir = new char[260];;
  2.      char image_path[260];            
  3.      getFilePath(input_dir, image_path);   
  4.  
  5.      // batch convert all supported bitmaps
  6.      _finddata_t finddata;
  7.      long handle = _findfirst(image_path, &finddata);
  8.      //
  9.       ....
  10.      //
  11.  
  12.  
Nov 2 '07 #1
1 1102
mpage
3 New Member
and when i want to create the new file name i do this



Expand|Select|Wrap|Line Numbers
  1.        int largoNom = strlen(finddata.name);
  2.        largoNom += 5;
  3.        char *unique = new char[largoNom];
  4.        largoNom -= 9;
  5.        strncpy(unique,finddata.name,largoNom);
  6.        strcat(unique,"_res");
  7.        strcat(unique,".bmp");
  8.        FunFI::GenericWriter(dib, unique, PNG_DEFAULT);
  9.  

If I show in console unique and finddata.name its the same thing i was telling you, so it isnt a problem with te libery.
Nov 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
3853
by: krini_pop | last post by:
I have a string that is delimited by commas. I'm using strtok and putting the values in a vector. In some cases, I may have 2 commas side by side and therefore need it to insert a null value. Right now, when it encounters this it puts the next value in the vector and throws everything else off. Does anyone know how I can insert a null value...
14
4282
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to salvage the records from the many table and without going into detail, one of the reasons I can't do the opposite as there are records in the ONE table...
0
4482
by: ImraneA | last post by:
Hi there I had pleasure of upsizing Access v97 db to Access v2K/SQL 2K. Wish to provide some knowledge gained back to community - hopefully help others. 1.Question how do you test stored procedure from SQL Server vs MS Access point of view ?
5
7024
by: SSP | last post by:
Dear ASP.NETers, How would I insert multiple rows of data from a web form? Are there any tute's and stuff around. Couldn't find any myself. Thanks in advance. SSP
4
2194
by: Mike Hnatt | last post by:
My goal is to get data from an XML file into a couple of tables in an Access database. The XML file is a little complex so I need control over what I do (I can't just read it into a dataset). The way I have it now is ennumerating through my XML file and for each record, running an INSERT INTO SQL statement to put the values in the...
5
3233
by: Chris | last post by:
Based upon some prevoius postings on what to do for adding a 'add' row to a datagrid I utilize the footer to create the 'add' row. The only issue is that I have it sharing the 'UpDate_Command' and I use an argument to difference between an 'edit' vs. and 'add. But since I have field validation on both 'footer' and 'edit' columns I can't submit...
20
5616
by: Guadala Harry | last post by:
In an ASCX, I have a Literal control into which I inject a at runtime. litInjectedContent.Text = dataClass.GetHTMLSnippetFromDB(someID); This works great as long as the contains just client-side HTML, CSS, etc. What I want to do is somehow insert a *server control* into the , then set the server control's properties at runtime.
2
2797
by: jonceramic | last post by:
Hi, Question... Is there any way to put a wrapper on a raw string going through SQL, or should I bite the bullet and use a recordset method instead? Situation: I'm trying to have the user add comment data to a table. I calculate and/or determine all of the variables except for that comment.
6
3678
by: sgulciny | last post by:
hi friends; I have problem about sql server insert and update in client side. I am coding windows application with c#.When I run my code in database server computer all is fine.I can see data, insert and update.But when I run same code in client side I can see data but not insert not update what can I do about this problem .I use sql server...
4
2175
by: =?Utf-8?B?RXJpYyBGYWxza2Vu?= | last post by:
We’re storing our main entity in an insert only table which stores the history of past revisions, but we’re facing problems with storing this history as LINQ will only update the entity, and not reinsert it with a different revision number. Compounding the issue, we’ve also got an associated table storing properties for our entities...
0
7911
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8200
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7954
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8215
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3836
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1448
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.