C :: Declaration Of Array In Another Source File
May 5, 2014
I was going through a code where i found the definition of int array[63] in one of the source files. But i also found the declaration as extern int array[66] in another source file. This is clearly wrong, but my doubt is how the compiler compiled it. It should have thrown error. In case if it compiles then what will be the behavior of the system? Will it be normal or some undefined behavior?
View 3 Replies
Dec 11, 2014
I wanted to share the value of a variable from Sender Program to Receive after program and want to calculate difference between send and receive. After studying Header file concept I program following three.
Now I am struck. How to to compile? I link all these file. I used following method:
Code:
gcc Sender.c -o Sender Sender.h
gcc Receiver.c -o Receiver Student.h
Then I run Sender and after that Receiver.I per my knowledge, Receiver should give difference but it gives error :
Code:
Receiver.c: In function "main":
Receiver.c:10:42: error: "Send" undeclared (first use in this function)
printf(" Total Receive is %d
",Receive-Send);
Code:
Sender.c
#include <stdio.h>
int Send ;
void main(){
[Code] ....
View 2 Replies
View Related
Jan 30, 2013
My socket.cpp program got error. it showed "socket.h: no such file or directory". I had put my header file (socket.h) in the same place with my source file.
View 1 Replies
View Related
Jan 7, 2013
I would like to know the difference between the following two forms of array declaration:
(1)double myArray[3] = {1.0, 2.0, 3.0};
(2)array<double,3> myArray = {1.0, 2.0, 3.0};
If I say the second one allows to use different functions like .begin(), am I right? Is there any other difference between these two declaration?
View 6 Replies
View Related
Apr 25, 2013
i have 1 class with several class's and 1 structure:
Code:
struct Images {
HBITMAP ImageImage;
BITMAP Imagebm;
HDC ImagehdcMem;
HBITMAP ImageMaskImage;
[Code] .....
But I get these error:
"--------------------Configuration: Sprite2 - Win32 Debug--------------------
Compiling...
Test Sprite2.cpp
C:UsersJoaquimDocumentsVisual C 98Sprite2Test Sprite2.cpp(23) : error C2440: 'type cast' : cannot convert from 'void *' to 'struct Images'
No constructor could take the source type, or constructor overload resolution was ambiguous
Error executing cl.exe.
Sprite2.exe - 1 error(s), 0 warning(s)"
I try search more code, but i get more errors ...
View 14 Replies
View Related
Sep 4, 2013
I use a programming language called layout which nobody here has probably ever heard of. It was discontinued over 15 years years ago but it was a very visual & easy to use piece of software - no coding required. In fact once you name all the variables on cards (forms) from then on it's just mouse clicking & occassionaly typing a number if required. It used blackboxes in a flowchart arrangement which were pre-done code for doing just about anything. i.e opening windows, handling numbers & text, files etc. I have written many programs with it including database management, quoting software & currently use it in my business to track my jobs & do invoicing & ordering. It's a pity it wasn't updated & still around today.
[URL]
Back to the problem. Being a 16 bit program it was written to run on Windows 3.1 but still works on Windows 7!! as long as it is the 32 bit version. I need to write a program that will run on 64 bit W7 without resorting to using a virtual PC solution. I have tried to find something similar that I might be able to use instead but so far nothing comes close to Layout. I just remembered today that layout can produce not only .exe programs but also various versions of C/C++ including visual c++. So I got this idea that if I could get those files I might be able to stick them into a C compiler program to re-make a "modern" exe file.
I could just do a simple sample program & send the source code to them to see if it works on a 64 bit version of Windows 7. how I can do this myself to produce a working exe file.
View 5 Replies
View Related
Jun 5, 2014
how to get source path of selected file.
for example :
selected image in E:/
E:ewfolderillustration.jpg
application - asp.net(C#)
View 4 Replies
View Related
Nov 3, 2013
Visual studio 2012
I have a project that has a few .asm files (assembly language code), I have the compiler/assembler set to create a list file for the assembly code and would like the debugger to use the .lst file for the source instead of the .asm files because in the .asm files the macros are not expanded like they are in the .lst files which makes debugging difficult sometimes.
View 1 Replies
View Related
Jan 24, 2014
I want to understand the ways in which arrays can be declared and used. What each of the following do or what's the difference between them and what would be the length of each:-
1 - char ary1[50];
2 - char ary2[50] = {'H','e','l','l','o'};
3 - char ary3[50] = {'H','e','l','l','o','