473,804 Members | 3,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using system("xxxxx")

T O
Hi all,

I am very new to C programming and have come across problem.

My programme has opened and created a text document on the hard drive.
The document name is stored in a string called "output".

At the end of the program, I want to open the outputfile.txt
automatically using notepad.

So I figure what I want to do is

system("notepad .exe %s",output);

but of course it doesn't work.

Can anyone tell me if it is possible and if so how.

Can anyone tell me a good site that has full syntax for such command. I
have C Primer plus etc, and other books but they all lack info on such
commands.

Thanks very much in anticipation
Nov 14 '05
11 8363
Keith Thompson <ks***@mib.or g> wrote:
T O <TO> writes:
I have to use Dev C++ for this particular project(not my choice)
A good one, though.
and snprintf and sprintf don't appear to be in any of the libraries with
it (unless someone can tell me different).


Can Dev C++ be told to act as a C compiler, or is it just a C++
compiler?


Yes; in fact, I only use it as a compiler (or rather compiler
environment; Dev-C++ itself is a shell around gcc + MingW or Cygwin) for
two languages, one of which is C and the other of which is not C++.

Richard
Nov 14 '05 #11
On Sat, 29 Jan 2005 05:11:50 GMT, Keith Thompson <ks***@mib.or g>
wrote:
T O <TO> writes:
[...]
I have to use Dev C++ for this particular project(not my choice) and
snprintf and sprintf don't appear to be in any of the libraries with
it (unless someone can tell me different).
<snip> sprintf() is a standard C function (and C++ incorporates the C
library). Try "#include <string.h>". <OT>If you're stuck using it as
a C++ compiler, try "#include <cstring>" (I think).</OT>

sprintf is in <stdio.h>. (Standard) C++ supports the C headers as both
<xxx.h> which puts (leaves) the names in the global namespace, and
<cxxx> which puts functions in std. It is the _C++_ headers where the
standard has only e.g. <iostream> in std not the prestandard
common-use <iostream.h> in global.

- David.Thompson1 at worldnet.att.ne t
Nov 14 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
10215
by: Copelandia Cyanescens | last post by:
Python Python 2.3.4, Windows, "clean" install, using the example code given in the documentation, I get this... Traceback (most recent call last): File "C:\projects\email\email.py", line 24, in ? server = smtplib.SMTP('mail.xxxxx.xxx') AttributeError: 'module' object has no attribute 'SMTP' I beg to differ, it most certainly does. Right? :)
19
14061
by: Lauren Wilson | last post by:
A2K app: Question: is the flagged line (<<<) below necessary. If that line is needed, what effect does it have (if any) on the fact that the very same database is the linked back end db? Dim db As DAO.Database Dim rst As DAO.Recordset
4
4223
by: Ollie | last post by:
I have wrriten a reverse proxy for a client of mine, this reverse proxy takes the url takes it attempt to access a *.XXXX and returns the the contents of an aspx web page from another internal server, the user then clicks on a button on the page that then posts data to the reverse proxy and it routes to the correct page by creating a web request and setting the method to post. (the reverse proxy is written using the IHttpHandler interface...
2
3299
by: Jeff_Mac | last post by:
Hi there. I'm a bit of a newbie, and I would appreciate any help that anyone can give me on an error I'm getting with Crystal Reports. Every time I attempt to view a report using the Crystal Report Viewer, I get a "Load Report Failed" error, and I'm not sure what I can do to resolve it. I know it's not the connection to the data -- I'm able to get a datagrid to display the data just fine after filling a dataset. I tried searching the...
11
2151
by: Thomas A | last post by:
Hi, I fill a datgrid with data from a xml document, it works fine But.... Now I will to filter the data to the grid so only the data shows from the criteria that I set. My code now is very simple to fill the grid
169
9226
by: JohnQ | last post by:
(The "C++ Grammer" thread in comp.lang.c++.moderated prompted this post). It would be more than a little bit nice if C++ was much "cleaner" (less complex) so that it wasn't a major world wide untaking to create a toolchain for it. Way back when, there used to be something called "Small C". I wonder if the creator(s) of that would want to embark on creating a nice little Small C++ compiler devoid of C++ language features that make...
3
3292
by: Aaron | last post by:
I'm trying to parse a table on a webpage to pull down some data I need. The page is based off of information entered into a form. when you submit the data from the form it displays a "Searching..." page then, refreshes and displays the table I want. I have code that grabs data from the page using cURL but when I look at the data it contains the "Searching..." page and not the table that I want. below is the code i have so far....Thanks...
1
1868
by: mlangley | last post by:
Hi there. I am trying to figure out a way to create a series of empty records in a database (ACCESS 2003). Basically, the table has 10 years of information by id. However, if there is no ID, then there is no record. I would like to make a record that simply does not have any data in it in that case. For instance if have: ID YEAR DATA a 1 xxxxx a 2 xxxxx a 3 xxxxx a ...
14
12072
by: dieselxeon | last post by:
hi everyone .. I am a student and i am learning how to create form using vb but i am stuck here since this is my school project, I need someone to help me to figgure out what is wrong with my code.also i try to create store procedure in sql 2005 and it give me This error Msg 245, Level 16, State 1, Line 2 Conversion failed when converting the varchar value '@Itinerary.ticketid' to data type int(but my ticketid value already integer not...
0
9706
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10575
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10330
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10076
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9144
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6851
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5520
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4297
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
3
2990
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.