Questions tagged [include]

A provision that many programming languages provide to allow functionality defined in one file to be used in another.

include is a provision that many programming languages provide to allow functionality (code such as functions, classes, objects etc.) in one file or package to be referenced and used in another.

Example (PHP)

include './dir/file.php';

Resources

9740 questions
3
votes
1 answer

Why do i have to #include "stdafx.h" in Microsoft visual studio c++ applications?

If i use a normal text editor or Code::Blocks this problem didn't occur. but in visual studio , I have to include stdafx.h header file in order to compile the program without errors. I want to know whats the use of this header file and why its in…
user5543585
3
votes
1 answer

jsp:include , performance, modularization, alternatives and best practices, Part 96

This is a follow-up to the 'overhead of jsp include' question below: JSP Performance using jsp:include In our application, developers have 'modularized' jsp fragments by heavy use of "jsp:includes" for "common" jsp code repeated throughout the…
user331465
  • 2,984
  • 13
  • 47
  • 77
3
votes
2 answers

PHP: 'include', but don't run

I have a test.php, where I run unit test cases. What I want is to 'include' certain .php files, but when I do it, they get run. For example, I just need to access certain variables, functions from a .php file, but the whole .php file gets run. In my…
AmazingDayToday
  • 3,724
  • 14
  • 35
  • 67
3
votes
6 answers

Purpose of: #define, #include, #undef

What would the purpose of this construct in a c file be?: #define _TIMERC #include "timer.h" #undef _TIMERC I am aware of the guard for preventing multiple inclusion of a header file. This doesn't appear to be whats happening though. thanks!
JeffV
  • 52,985
  • 32
  • 103
  • 124
3
votes
2 answers

Can't I put my javascript files outside html public folder?

I'm following this tutorial to create a safe login system. My folder logic is as follows: /var/www/html/mysite/ # html folder is public (here goes index.php, etc) /var/www/includes/ # includes is hidden (login details, etc) /var/www/js/ …
Rodrigo
  • 4,706
  • 6
  • 51
  • 94
3
votes
2 answers

C header and source file confusion

I wrote myself a littly module I want to reuse. I got my header file bitstream.h with a struct and function declarations and bitstream.c with the implementations. Now I'd like to use this in my other programs, but without manually compiling…
smuecke
  • 45
  • 5
3
votes
1 answer

dynamic url path from current file in changing directories with php

I need to include the same file (navigation.php) from differing directories and file path structures. for instance i need to dynamically change the file depth eg: include '../../../navigation.php'; and include…
user5411951
3
votes
4 answers

Correct format of #include directive

What's the correct/recommended way to include a file? I'm getting trouble with inclusion (VS2005 compiler...). I know the correct way is this: #include "source.cpp" or this: #include Could # include "source.cpp" cause problems (added…
ProtectedVoid
  • 1,293
  • 3
  • 17
  • 42
3
votes
1 answer

Limit scope of included platform header to to just the header file including it?

I'm working on a C++ library project. I need to include a platform specific header to get access to some #defines. The catch is, I only want the platform's header visible within my my header. For those including my header, I don't want them to see…
jww
  • 97,681
  • 90
  • 411
  • 885
3
votes
5 answers

Is 148 Included files too many

I've just noticed that my app is including over 148 php files on one page. Bear in mind this is the back end admin and not the main site, but is this too many? What impact does a large number of includes have on a server, both whilst under average…
buggedcom
  • 1,537
  • 2
  • 18
  • 34
3
votes
5 answers

Better/safer way to use php include?

this works for me, but is there a better/safer way to use an include: I tried: but it did not work.
Barry
  • 63
  • 1
  • 5
3
votes
4 answers

PHP Checksum before include()

I've been working on an application that will allow for third-party extensions to be built to expand the application's functionality. All this in PHP, of course. I wanted to add a bit of security padding by running files in a certain directory…
Swivel
  • 3,020
  • 26
  • 36
3
votes
2 answers

C header directive needed in function declaration file?

I am in the process of exploring the C programming language and have started to learn about header files. I am working with three different files in my program. One header file and two source files: encrypt.h void encrypt(char…
Adam Bak
  • 1,269
  • 12
  • 15
3
votes
0 answers

JavaFx: How to make an fx:include to fill the parent pane

I want to build a tab view. I like to put the content of each tab in a separate FXML file. With I can import an FXML into my main FMXL. The import works fine but unfortunately the Details.fxml content is only…
Manuel
  • 319
  • 4
  • 14
3
votes
1 answer

C++ Error: conversion to non-scalar type requested?

I'm fairly new to C++ and i'm trying to build a linked list with a container class called FlexString. In main() I want to instantiate the FlexString class by simply saying: "FlexString flex_str = new FlexString();" calling the constructor etc. But…
camohreally
  • 149
  • 3
  • 4
  • 17
1 2 3
99
100