Sponsored Content
Full Discussion: Missing cout
Top Forums Programming Missing cout Post 302962841 by sea on Saturday 19th of December 2015 03:15:36 AM
Old 12-19-2015
Missing cout

Heyas

Me trying some C.. cout in specific, thats what i remembered:

Code:
#include <stdio.h>
// -- Just the above or with all the below ones, no change 
#include <stdio_ext.h>
#include <stdlib.h>
#include <wchar.h>
//#include <iostream>	// I assume its the same anyway?
//#include <iostream.h> // But since these fail, and cout still is missing, i have no idea
#include <string.h>
#include <strings.h>
#include <stropts.h>
//#include <stream.h>
//#include <io.h>
#include <stdint.h>
#include <stdfix.h>
#include <unistdio.h>
#include <libio.h>
//#include <input.h>
//#include <sdbout.h>
//#include <system.h>
//#include <errors.h>
//#include <options.h>
//#include <filenames.h>
//#include <shout.h>
//#include <system.h>

//#include <regexp.h>
//#include <keyutils.h>


void main(){
	cout "Hello"; 		// Upon inital error msg, recalled this was wrong
	cout << "Hello"; 	// So tried this one
	std::cout << "Hello";	// This one's from a guide but fails too
	std:cout << "Hello";	// didnt see that before, but since above failed because of '::'
}

I've seen the bold include lines associated with it, but it fails:
Code:
0 ~/prjs/c-learnings/1-output $ build-it cout

+ LC_ALL=C
+ gcc -o cout cout.c
cout.c: In function 'main':
cout.c:30:2: error: 'cout' undeclared (first use in this function)
  cout "Hello";   // Upon inital error msg, recalled this was wrong
  ^
cout.c:30:2: note: each undeclared identifier is reported only once for each function it appears in
cout.c:30:7: error: expected ';' before string constant
  cout "Hello";   // Upon inital error msg, recalled this was wrong
       ^
cout.c:32:6: error: expected expression before ':' token
  std::cout << "Hello"; // This one's from a guide but fails too
      ^
cout.c:33:2: error: duplicate label 'std'
  std:cout << "Hello"; // didnt see that before, but since above failed because of '::'
  ^
cout.c:32:2: note: previous definition of 'std' was here
  std::cout << "Hello"; // This one's from a guide but fails too
  ^
+ RET=1
+ '[' 0 -eq 1 ']'
+ set +x

Any ideas, thank you
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

what am I missing?

I have the following portion of a script Check() { echo "\n\nChecking that all constraints are Enabled" echo "..." sleep 2 CHECK_COUNT='sqlplus -s $1 <<-EOSQL4 set feed off pause off pages 0 head off; set linesize 150 echo off; select count(*) from user_constraints where... (4 Replies)
Discussion started by: Zelp
4 Replies

2. UNIX for Dummies Questions & Answers

cout doesn't print everything

Hi all, I implemented a C++ program and successfully compiled and ran on my laptop. However when I copy my code to another machine (school's sun machine), it didn't run properly. I can compile and run, but cout does not print everything. I used cout in a loop where it iterates no more than 20... (5 Replies)
Discussion started by: SaTYR
5 Replies

3. Programming

library for cout question

Hi I am running Ubuntu 9.10 and I use QtCreator for my C++ Programms. I knwo that in wondows OS cout is located in iostream.h library. It seems that it isn;t the same library in Qtcrator... :( Anyway, iostream.h doesn't exist and iostream (without the .h) exists but doesn't seem to include the... (4 Replies)
Discussion started by: hakermania
4 Replies

4. Programming

"cout = outFile" is not compiled

Hello, Compilation of the line "cout = outFile" throws error "Error: std::ios_base::operator=(const std::ios_base&) is not accessible from std::ios ::operator=(const std::ios &)." outFile is declared as "static ofstream". Thanks, Shafi (3 Replies)
Discussion started by: shafi2all
3 Replies

5. Programming

std::cout and gfortran print*, don't output to the screen

I am not sure where to post this other than here. I am trying to figure out why an app gives different output when compiled under Ubuntu 10.10 and CentOS 5.5. I am pretty sure that the issue is that the Cent version has gcc 4.1 installed, while Ubuntu has gcc 4.4. I am trying to print from some... (20 Replies)
Discussion started by: LMHmedchem
20 Replies

6. Shell Programming and Scripting

[: missing `]'

Hi, I am getting this error while running the following code. i=`awk '{print $2}' test1.txt` j=`awk '{print $4}' test1.txt` k=`awk '{print $6}' test1.txt` if ; then echo "Up." else echo "down" fi rm -f test.txt test1.txt error is this: line 12: ' Please suggest. (2 Replies)
Discussion started by: arijitsaha
2 Replies

7. SuSE

How to resolve missing missing dependencies with opensuse 11.3 and 12.3?

Hello, This is a programming question as well as a suse question, so let me know if you think I should post this in programming. I have an application that I compiled under opensuse 12.2 using g77-3.3/g++3.3. The program compiles and runs just fine. I gave the application to a colleague who... (2 Replies)
Discussion started by: LMHmedchem
2 Replies

8. Red Hat

Yum - resolving missing dependencies that are not missing

I am trying to install VirtualBox on RHEL 5 but I need the 32 bit version for 32 bit Windows. When I run yum I get the following: sudo yum localinstall /auto/spvtg-it/spvss-migration/Software/VirtualBox-4.3-4.3.2_90405_el6-1.i686.rpm Loaded plugins: fastestmirror Setting up Local Package... (13 Replies)
Discussion started by: gw1500se
13 Replies

9. Programming

Concatenate integer and space/newline for cout in C++

I'm trying to print out integers and space/newline for a nicer output, for example, every 20 integers in a row with ternary operator. In C I could do it with:printf("%d%s",tmp_int, ((j+1)%20) ? "\t":"\n"); but could not figure out the equivalent in C++: cout << ((j+1)%20)?... (4 Replies)
Discussion started by: yifangt
4 Replies
FBB::mlm(3bobcat)                                             OFoldStream manipulator                                            FBB::mlm(3bobcat)

NAME
FBB::mlm - Manipulator modifying left margins of OFoldStream objects SYNOPSIS
#include <bobcat/ofoldstream> or #include <bobcat/ofoldstreambuf> Linking option: -lbobcat DESCRIPTION
The mlm class implements a manipulator that can be inserted into OFoldStream objects to modify the stream's left margin by a requested amount. The request cannot result in a negative left margin value. If a negative left margin would be the arithmetic result of the request then left margin 0 will silently be used. Depending on the tab-setting of the OFoldStream the inserted value represents the number of blank space characters or the number of tab-characters that will be added to the left margin. The request will be processed at the next newline character or std::flush or std::endl manipulator that is inserted into the stream. If a line is still empty once an mlm object and a flush manipulator are inserted into the stream then the new left margin will be effective at the next word inserted into that line (cf., the example section below) A bad_cast exception is thrown when the manipulator is inserted into an ostream that is not using a OFoldStreambuf buffer. NAMESPACE
FBB All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB. INHERITS FROM
- CONSTRUCTOR
o mlm(int addValue): The standard copy constructor is available. MEMBER FUNCTIONS
There are no public or protected member functions in this class. EXAMPLE
#include <iostream> #include <bobcat/ofoldstream> using namespace std; using namespace FBB; int main() { OFoldStream out(cout, 0, 80); out << "hello world (left margin is 0)" << mlm(4) << " " "this uses a 4 character wide left margin " << mlm(-10) << flush << "left margin -6 changed to 0, active on this line "; return 0; } FILES
bobcat/mlm - defines the class interface SEE ALSO
bobcat(7), manipulators(3bobcat), lm(3bobcat), ofoldstream(3bobcat) BUGS
None Reported. DISTRIBUTION FILES
o bobcat_3.01.00-x.dsc: detached signature; o bobcat_3.01.00-x.tar.gz: source archive; o bobcat_3.01.00-x_i386.changes: change log; o libbobcat1_3.01.00-x_*.deb: debian package holding the libraries; o libbobcat1-dev_3.01.00-x_*.deb: debian package holding the libraries, headers and manual pages; o http://sourceforge.net/projects/bobcat: public archive location; BOBCAT
Bobcat is an acronym of `Brokken's Own Base Classes And Templates'. COPYRIGHT
This is free software, distributed under the terms of the GNU General Public License (GPL). AUTHOR
Frank B. Brokken (f.b.brokken@rug.nl). libbobcat1-dev_3.01.00-x.tar.gz 2005-2012 FBB::mlm(3bobcat)
All times are GMT -4. The time now is 06:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy