473,320 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

C programme

2
Hiya can anyone help me,

I am attempting to reverse a stack programme and have come up with

void reverse(int stack[], int *top)
{

int temp [*top];
for (int i=0; i <*top;i++){
temp[*top-i] = stack[i];
}
for (int i=0; i <*top;i++){
stack[i] = temp[i];
}
printf("Stack is now reversed\n");
}

void main()
{
int stack[MAX];
int top = -1;
int n,value;

scanf("%d",&n);

push(stack,&top,value);
pop(stack,&top,&value);
empty(&top);
reverse(stack,&top);
}


However when I attempt to compile the whole programme using digital mars dmc I get........ linkstack_array_new,,,user32+kernel32/noi;

does anyone know what this means.

Thanks
Nov 8 '07 #1
1 1336
weaknessforcats
9,208 Expert Mod 8TB
void reverse(int stack[], int *top)
{

int temp [*top]; <<< NON ANSI C++
I do see you are using variable stack arrays. Since that is no ANSI C++ but is a non-standard enhacement to your compiler, it's hard to say what else is not standard.

I suspect the -1 for top has gotten into your reverse() function.
Nov 8 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: cm012b5105 | last post by:
Hello i want to put an interactive text programme in to a graphical box this is a small section of my text programme s = raw_input ("Hello whats your name? ") if s=='melvyn': print "your my...
0
by: melledge | last post by:
Full Programme for XTech 2005 Announced Premier European XML Industry Event Expands Focus to "XML, the Web and Beyond"; Co-hosted by the Mozilla Foundation,W3C, and OASIS, Presenters Include...
2
by: NDAKI MBOULET | last post by:
J'ai un problème pour écrire un programme. Voici mon sujet: Ecrire en c++ un programme qui reçoit en entrée une suite d'instruction encadrées par les mots clés BIBODLE et LISUK dans un langage...
5
by: Pekka Jarvela | last post by:
I am a beginner and have written a C++ programme in Visual Studio ..NET. Now, programme is for time being Console application (= works in DOS window). I would however like that it had graphical...
5
by: katekukku | last post by:
HI, I need the source code for a programme in C. It should have the basic features of a paint programme like circle, line etc, etc,. I lost a programme which wa driven by keyboard, if somebody...
18
by: arnuld | last post by:
i compiled the "hello world" programme from K&R2: #include<stdio.h> int main() { printf("hello world\n"); }
4
by: arnuld | last post by:
this is my final code. Can you folks advise some improvements for making this programme better? BTW, i aways compile my programme with this cmmand on Linux: g++ -ansi -pedantic -Wall -Wextra...
0
by: =?Utf-8?B?SmF5ZQ==?= | last post by:
I have created the programme, then using the font in Office 2007. However the user's PC haven't install the font style, when i publish my programme by clickonce, and the user use it, the font style...
6
by: =?ISO-8859-1?Q?FERHAT_A=C7ICI?= | last post by:
hi everyone...I want to run any programme or file with my programme.example any file or programme, like this "xxx.ncn".I want If users double click this xxx.ncn this file can run by my...
7
vikas251074
by: vikas251074 | last post by:
Can I get automatic focus on first text item just after running programme? Because when I run the programme, there is no focus on any text item at the first instant. I have to use mouse to go to...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.