473,508 Members | 2,490 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 1094
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
3851
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...
14
4269
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...
0
4471
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...
5
7014
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
2186
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). ...
5
3224
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...
20
5594
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...
2
2781
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...
6
3673
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,...
4
2174
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...
0
7231
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,...
0
7133
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...
0
7336
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,...
0
7405
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7066
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...
0
5643
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,...
0
3214
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...
0
1568
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 ...
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.