theFlash
?
K
like “continue: yes or no”
K
yess exactly
theFlash
Use do while loop
theFlash
Do you know syntax of do while ?
K
i know do while
theFlash
do {
statement(s);
} while( condition );
theFlash
Read character after switch
theFlash
Then in while condition put ch=='y'
theFlash
Before reading print
theFlash
If you want to continue press 'y'
theFlash
That's it
K
wow, that’s a brilliant
K
thank you for your help, may god bless you!
theFlash
Is it worked ?
K
i’ll try it
darshpreets
#include <fstream>
#include <string.h>
#include <iostream>
using namespace std;
int fileSearch(string filename, string word)
{
//for storing words in it;
string input;
// for counting the line number of the string
int line=0;
ifstream fopen;
fopen.open(filename,std::fstream::in);
if (!fopen) {
cout << "Can't open input file!";
return -2;
}
else
{
while (fopen>>input)
{
if (input == word){
line++;
fopen.close();
return line;
}
if (input[input.length()] == '\n')
line++;
}
if (line == 0)
{
fopen.close();
return -1;
}
}
}
int main(int argc, char const *argv[])
{
cout<<"the line number is: "<<fileSearch("sample.txt","back")<<endl;
return 0;
}
darshpreets
i have this error in code dps@machine:~/Documents/Chegg$ gcc read_file.cpp
read_file.cpp: In function ‘int fileSearch(std::__cxx11::string, std::__cxx11::string)’:
read_file.cpp:13:38: error: no matching function for call to ‘std::basic_ifstream<char>::open(std::__cxx11::string&, const openmode&)’
fopen.open(filename,std::fstream::in);
^
In file included from read_file.cpp:1:0:
/usr/include/c++/5/fstream:595:7: note: candidate: void std::basic_ifstream<_CharT, _Traits>::open(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]
open(const char* __s, ios_base::openmode __mode = ios_base::in)
^
/usr/include/c++/5/fstream:595:7: note: no known conversion for argument 1 from ‘std::__cxx11::string {aka std::__cxx11::basic_string<char>}’ to ‘const char*’ not able to figure it out why can some one help
Roxifλsz 🇱🇹
Anonymous
Anonymous
Anonymous
Like that deadlock, memory management, device management
Anonymous
In c
Anonymous
Anonymous
Provide me notes and other documents
Roxifλsz 🇱🇹
Anonymous
😂🔫
☬ੴ Bassi
Sharing is caring
Anonymous
Ya u are bt I knowledge that thing so I tell
Anonymous
Anonymous
DuckDuckGo 🤘🤟
Mike
Somebody have one curse of glade and gtk?
Anonymous
Hi
Onur
I have a question about pass by reference methods lets say we have a function called void foo(int& a)
why we call function by writing foo(b) but not foo(&b)? In that case we would know if method is taking value of the object or reference of the object itself.
Anonymous
Anonymous
but i guess is was done so caller no longer has to care how the call is implemented and wont need to create new objects or vars specifically for a call
Onur
what do you mean by "is was done"? Sorry I don't get it
correctmaninwrongplace
correctmaninwrongplace
Is this the answer You were looking for?
Anonymous
*The reference is not a variable. *
Aman Sharma
Anonymous
Hi guys
Andrey
Sup
Anonymous
Hi, String is 'ABCD' we want to seach it in the huge text file. fastest way ? Can Trie Data Structure be used here somehow ?
King
How to combine two Wifi Connections to get a faster Internet
You have more than one active internet connections and you are using only one at a time, while the other is resting? Don't let it be lazy. Combine them all to get combined internet speed. Say you have two connections of 1 Mbps each, you just can make 1+1=2. This can work regardless of the type of the connections, i.e. it may be wired, wireless or mobile communication.
Method 1 of 4: Combining LANs
Steps:
1. Turn everything on your computer, modems (in case of DSL).
2. Connect them on the relative ports.
3. Establish Connections. Dial or do whatever you need to do to establish an Internet connection and test each one by one separately. If all good proceed to the next step.
4. While each one is active and connected, navigate to the "Network Devices" folder of your computer. It usually stays under control panel.
Windows 8 or Windows 8.1, press Windows D to navigate to the desktop, and the rest is the same as windows 7 below.
For Windows 7 and Vista, Click the network icon on the task bar-> then click \ Open Network and Sharing Center\ . Then click \ Change Adapter settings\
5. Review the Connections. Review the window showing all of your network connections.
6. Drag and select. Drag and select Active LAN (Wired, Wireless or DSL Modem) connections.
7. Right click on one of the selected-> click "Bridge Connections." Then wait and a network bridge with different icon will appear. You might have to provide administrative right.
*Method 2 of 4: Load Balancing*
If you connect 2 internet connection to Windows at a time, the operating system automatically selects one connection as primary and uses others as as failover connection mode. You can force Windows 7, 8 to use both connections simultaneously using a simple trick.
Steps:
►Open Network and Sharing Center > Change Adapter Settings
►Go to properties of any of your active Internet connection whether it be LAN, WiFi or 3G/4G.
►Select Internet Protocol TCP/IP Version 4, Open its properties, then go to advanced.
►Uncheck the Automatic Metric and type “15”.
►Repeat same steps on other Internet connections you want to combine.
►Restart your Computer.
Method 3 of 4:Using Connectify Hotspot
Steps:
►Download the Connectify Dispatch
►Install the Dispatch software.
►Run. Then click "Start Dispatch".
►Connect all your modems or network connections
Method 4 of 4: Using Speedify
Steps:
►Speedify is a new cloud service from the makers of Connectify, that lets you easily combine multiple WiFi, 3G/4G, and wired networks to create one faster and more reliable Internet connection.
►Visit [www.speedify.com] to begin your free, 3-day trial. Once your trial has started, you will receive an email with your login and a download link for the Speedify client software (for Mac OS X+ & PC)
►Install the Speedify software and then simply enter the email and password that you received from Speedify to log into the Speedify server netwok
►Click the 'Speed Me Up' button to log in. Speedify will automatically connect you to the nearest and fastest Speed Server to ensure that you get the maximum speed and reliability of your Internet connections combined.
►Now, just ensure that you have two or more WiFi, mobile broadband, or wired Internet connections active on your computer, and Speedify does the rest:
►Connect all your modems or network connections.
Yodahell
do you guys have some pdf that will make c++ simple for beginers if you have one please upload it
Anonymous
Yes plz upload it...
Anonymous
Given a stream of integers, lookup the rank of a given integer x. Rank of an integer in stream is “Total number of elements less than or equal to x (not including x)”.
Anonymous
Bkrymwana
Where can I get c++ compiler and and an environment where I can code c++
Pancakem
What OS are you running?
Bkrymwana
Windows10
Pancakem
You could get MinGW compiler and Visual studio.
Nomid Íkorni-Sciurus
Bkrymwana
I have downloaded mingw and also downloading visual studio 2017....it sucks a lot of data
Murod
hi, guys. I have a question! is there any possible way to reprogram microchip of a bluetooth keyboard and mouse?
Anonymous
Nomid Íkorni-Sciurus
Nomid Íkorni-Sciurus
Anonymous
For starters it is easier to just download codeblocks bundled with mingw
Murod
bge is what?
K
how to build a code for membership that if we got membership, we will get 20% discount. before it, the output will display. for example, “got any membership? yes or no”. im sorry cuz asking this. im a newbie and currently make a project that have to submit on 19/3/18
Shirosacid
hi ,
im learning c++ , and i want to make 3 cin commands to type my forename, name and adress , and at the end cout the result. but after the first cin command i cant type the second or third cin command
and sorry for my basic english :)
НОЗИМ
fdf
theFlash
Anybody have learn c the hard way PDF or ebook
King
💝 Biggest Hack Pack By @ETHICAL HACKING 💝
➡Total Size 500 GB
➡Hacking E-Books
➡Hacking Tools
➡Hacking Videos
➡And Many More.....
Link:-- https://drive.google.com/drive/mobile/folders/0B28wiRqjwTwbbmRVU0lZXzJTZ28
😭 Don't Forget To Share Our Channel If You Like It 😔
By:-- @ADMIN
Channel Link 👉 https://t.me/joinchat/AAAAAEUOWwOXQxJshDXUKA
theFlash
Nomid Íkorni-Sciurus
Nomid Íkorni-Sciurus
@admin
Anonymous
Anonymous
Anonymous
Good documentation
Anonymous
/report
Thanks for your report but this message is not offtopic
Anonymous
theFlash