Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to read a unicode string using getline

Featured Replies

Hi to all

i m having problem in reading a unicode string from a unicode formatted file can any one direct me how to read a string till a given delimenator the code i m writing is

char buffer =new char[2500];

memset(buffer,'\0',strlen(buffer));

fstream fp,fp1;

fp.open("c:\\filedata1.txt",ios::in);

if (!fp.is_open())

{

cout << "couldn't open file" << endl;

exit(3);

}

else

while(!fp.eof())

{

fp.getline(buffer,2500,'¶');

fp1.open("c:\\notfounddata2.txt",ios::out);

fp1.write(buffer,2500);

cout<<buffer;

memset(buffer,'\0',strlen(buffer));

}

fp.close();

fp1.close();

}

Hi,

use the strstr function which gives you back the position of the first occurence of the wanted char's. Than read from the beginning of the string till this position.

when i need to read from a file till the occurence of a specific pattern i use a self written function which reads byte by byte and checks if i read the pattern i am looked for. post me a pm if you need those code.

Egon

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.