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

Home Posts Topics Members FAQ

how do you pass a filename parameter to the main function

1 New Member
Im trying to pass a filename parameter from the function to the main functio:

Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Text;
  3. using System.IO;
  4.  
  5. namespace Reaingthingyiles
  6.  
  7. {
  8.     class program{
  9.  
  10.  
  11.         public static void  checkit(StreamReader file)
  12.  
  13.     {
  14.         StreamReader thingy = new StreamReader(thingy);
  15.         while(!thingy.EndOStream)
  16.         {
  17.             string line = thingy.ReadLine();
  18.             Console.WriteLine(line);
  19.  
  20.         }
  21.  
  22.     }
  23.  
  24.  
  25.     static void Main()
  26.     {
  27.         checkit(new StreamReader (@"data.txt"));
  28.  
  29.     }
  30.   }
  31.  
  32. }
  33.  
  34.  
Im failing horribly I need some direction.
Apr 24 '16 #1
1 1628
madankarmukta
308 Contributor
May I please know what exactly you want to achieve?
Apr 24 '16 #2

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

Similar topics

12
38483
by: Huskier | last post by:
Hi all: I want to pass a class-member function to pthread_create, and my code is in the following, but I don't know how to pass myobj.thread_function to pthread_create function. #include <pthread.h> class test { public:
2
2433
by: Yarik | last post by:
Hello there! I am working with MS SQL Server 2000. I have a table function that takes an integer parameter and returns a table, and I can successfully use it like this (passing a literal as a parameter): SELECT * FROM MyTableFunction(1)
9
11355
by: Martoon | last post by:
I want to instantiate an STL map with my own compare function, and I want to pass a parameter to the compare function that will be stored and used for all comparisons in that map instance. As an example, let's say the map key is char* strings, and I want the comparison based on the nth character in the string. When the map is instantiated,...
15
3923
by: eric dexter | last post by:
csoundgrid2.main(filename, """;<sco_header>""") isn't working like I want it to. I was trying to find out what my value for filename is but it will not print. The file I am calling csoundgrid2.main seems to work fine when I call it directly from spe with two values and I have used this file dialog to load other files although I think it...
3
2409
by: Angus | last post by:
I have a program which when downloaded from a server downloads another program from the same web server and then configures the downloaded program. The trouble is I have to hard code in the program the URL to download the other program from. So I need to work out how I can do the same thing without having a hard coded URL in the file. It is...
28
6025
by: ravi | last post by:
Hello everybody, I am writing a small application which does some work before the user main function starts execution. I am trying to #define the main function. But the problem is that,
6
2065
by: Max | last post by:
i have a event bind function like this(though it is not so robust): bind$=function(o,evt,fn,cb){ var aE='attachEvent'; var aEL='addEventListener'; if(!o&&o){ return o(evt,fn,!!cb); } return o('on'+evt,fn); };
3
2332
by: Davy | last post by:
Hi all, Sometimes I need to pass same parameter in recursive function. From my point of view, the style is redundant, and I don't what to use some global style like self.A, self.B, Is there any other choice? For example, def func(self, x, y, A, B, C): #x, y change in recursive call
1
9330
by: Jorge | last post by:
On Oct 23, 10:36 am, Tuxedo <tux...@mailinator.comwrote: Yes: function first_function (PARAMETER) { preload_image = new Image(800,600); preload_image.onload = function () { photo_preloaded(PARAMETER); }; preload_image.src = 'images/photo.jpg'; }
1
14266
by: irGed | last post by:
Hi, I'm trying to pass a parameter to an VBA Excel function but I always got this error: Type Mismatch error This is my sample Excel function: Public Function OpenAndRepairWorkbook(X As String) As String
0
7915
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
8204
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. ...
0
8339
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7965
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
8220
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
6617
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
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3838
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...
0
3869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.