Questions tagged [header]

This tag is deprecated because it lacks discriminating power. Please use a more specific tag instead, e.g.: html-heading, email-header etc.

This tag is deprecated because it lacks discriminating power. Please use a more specific tag instead, e.g.: , etc.

13526 questions
226
votes
4 answers

Creating your own header file in C

Can anyone explain how to create a header file in C with a simple example from beginning to end.
Anuragdeb3
  • 2,299
  • 3
  • 14
  • 4
219
votes
10 answers

Where does gcc look for C and C++ header files?

On a Unix system, where does gcc look for header files? I spent a little time this morning looking for some system header files, so I thought this would be good information to have here.
Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
197
votes
9 answers

Should Jquery code go in header or footer?

Where is the best place to put Jquery code (or separate Jquery file)? Will pages load faster if I put it in the footer?
Simone
  • 1,981
  • 2
  • 12
  • 4
195
votes
13 answers

Replacing Header with Top Row

I currently have a dataframe that looks like this: Unnamed: 1 Unnamed: 2 Unnamed: 3 Unnamed: 4 0 Sample Number Group Number Sample Name Group Name 1 1.0 1.0 s_1 g_1 2 2.0 …
Jeremy G
  • 2,189
  • 2
  • 13
  • 14
190
votes
10 answers

Tool to track #include dependencies

Any good suggestions? Input will be the name of a header file and output should be a list (preferably a tree) of all files including it directly or indirectly.
Agnel Kurian
  • 57,975
  • 43
  • 146
  • 217
181
votes
8 answers

jQuery and AJAX response header

So I've got this jQuery AJAX call, and the response comes from the server in the form of a 302 redirect. I'd like to take this redirect and load it in an iframe, but when I try to view the header info with a javascript alert, it comes up null, even…
Shane
  • 1,811
  • 2
  • 12
  • 3
171
votes
10 answers

Adding header to all request with Retrofit 2

Retrofit 2's documentation says: Headers that need to be added to every request can be specified using an OkHttp interceptor. It can be done easily using the previous version, here's the related QA. But using retrofit 2, I couldn't find something…
Ashkan Sarlak
  • 7,124
  • 6
  • 39
  • 51
171
votes
15 answers

C++ Redefinition Header Files (winsock2.h)

How do I prevent from including header files twice? The problem is I'm including the in MyClass.h and then I'm including MyClass.h in many files, so it includes multiple times and redefinition error occurs. How to prevent? I'm using #pragma once…
akif
  • 12,034
  • 24
  • 73
  • 85
164
votes
4 answers

Javascript : Send JSON Object with Ajax?

Is this possible? xmlHttp.send({ "test" : "1", "test2" : "2", }); Maybe with: a header with content type : application/json?: xmlHttp.setRequestHeader('Content-Type', 'application/json') Otherwise I can…
Adam Halasz
  • 57,421
  • 66
  • 149
  • 213
163
votes
11 answers

How can I make sticky headers in RecyclerView? (Without external lib)

I want to fix my header views in the top of the screen like in the image below and without using external libraries. In my case, I don't want to do it alphabetically. I have two different types of views (Header and normal). I only want to fix to…
Jaume Colom
  • 1,701
  • 3
  • 11
  • 6
154
votes
11 answers

PHP page redirect

Can PHP make a redirect call after executing a function? I am creating a function on the completion of which I want it to redirect to a file located in the same root folder. Can it be done? if (...) { // I am using echo here. } else if…
amit
  • 10,133
  • 22
  • 72
  • 121
142
votes
3 answers

How to declare a structure in a header that is to be used by multiple files in c?

If I have a source.c file with a struct: struct a { int i; struct b { int j; } }; How can this struct be used in another file (i.e. func.c)? Should I create a new header file, declare the struct there and include that header in…
Manoj
141
votes
16 answers

Why won't my PHP app send a 404 error?

if (strstr($_SERVER['REQUEST_URI'],'index.php')) { header('HTTP/1.0 404 Not Found'); } Why wont this work? I get a blank page.
Yrrol
138
votes
5 answers

Should struct definitions go in .h or .c file?

I've seen both full definitions of structs in headers and just declarations—is there any advantage to one method over the other? If it makes a difference, I usually typedef a struct like so in the .h typedef struct s s_t; To be clear, the options…
Aaron Yodaiken
  • 19,163
  • 32
  • 103
  • 184
138
votes
13 answers

Cannot set some HTTP headers when using System.Net.WebRequest

When I try to add a HTTP header key/value pair on a WebRequest object, I get the following exception: This header must be modified using the appropriate property I've tried adding new values to the Headers collection by using the Add() method but…
Razor
  • 17,271
  • 25
  • 91
  • 138