FAQ Database Discussion Community


c struct in multiple file error: dereferencing pointer to incomplete type

c,pointers,types,struct,multiple-files
I am trying to declare a struct and use it in multiple files and I am getting an error that I cannot figure out. Sample code is posted below. in test.h #ifndef TEST_H #define TEST_H struct mystruct; struct mystruct *new_mystruct(); void myprint(struct mystruct*,int); #endif int test.c #include "test.h" #include <stdio.h>...

Read lines from Multiple files

python,multiple-files,readlines
I have two files: A: John Kevin Richard B: Manager Salesperson Doctor I am trying to read lines from both the files simultaneously and print the following: Output: John is a Manager Kevin is a Salesperson Richard is a Doctor I tried using contextlib.izip package but it's not working. Code:...

How do I pass an int map[60][60] array from my main.cpp file to my findpath.cpp file in c++?

c++,arrays,argument-passing,multiple-files
Alright so I've got an array int map[60][60]; which gets populated by walls and with a start position and such in int main(). Later I call on my path finding algorithm which is located in another .cpp file string route=findPath(xA, yA, xB, yB); which passes random start and end points...

How to use global variables in multiple .cpp files?

c++,global-variables,extern,multiple-files
I have this simple program which tries to print my global variable in a separate file. I'm using the Visual Studio 2013 professional IDE. print.h #ifndef PRINT_H_ #define PRINT_H_ void Print(); #endif print.cpp #include "print.h" #include <iostream> void Print() { std::cout << g_x << '\n'; } source.cpp #include <iostream> #include...

fopen multiple files to send mail with mail() php

php,email,send,multiple-files
i have problems to send mail with multiple files with mail() php. Until now, only send the first file, so i need your help please. Give you my code: HTML: <form action="colabora.php" method="post" enctype="multipart/form-data"> [...] <div id="adjuntos"> <input type="file" name="archivos[]" class="form-control"/> </div> [...] PHP: [...] if (isset ($_FILES["archivos"])) { $tot...