473,509 Members | 2,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Syntax error

4 New Member
Hi can anyone please help i have an error which says declaration syntax error at the main function thanks


# include<stdlib.h>
# include<conio.h>
# include<stdio.h>
# define MAXREN 3
# define MAXCOL 4
void ini_renmatdin (int*);
void ini_colmatdin (int *)

void main (void)
{
clrscr();
int *ap_mat;
int exito;
int S;
ap_mat=(int*)malloc(MAXREN*MAXCOL);
if(!ap_mat)
{
printf("\ ERROR: No hay espacio");
}
else
{
printf("\n Elija una opcion");
printf("\n 1.- Inicializar matriz por renglon, 2.- Inicializar matriz por columna");
scanf("%d",S);
switch(S)
{

case 1:

ini_renmatdin (ap_mat);
printf ("Exito si se inicializo");
break;

case 2:
ini_colmatdin (ap_mat);
printf ("Exito si se inicializo");
break;


default:printf("ERROR intente con los valores indicados en el menu");
}

}




getch();
}


void ini_renmatdin (int *ap_mat)
{
/*Inicializar una matriz por renglon en un arreglo dinamico*/
int *ap_aux;
ap_aux=ap_mat;
while(ap_aux<=(ap_mat+(MAXREN*MAXCOL-1)))
{
*ap_aux=0;
ap_aux=ap_aux+1;
}

}


void ini_colmatdin (int *ap_mat)
{
/*Inicializar una matriz por columna en un arreglo dinamico*/
int *ap_ren;
int *ap_col;
ap_col=ap_mat;
ap_aux=ap_mat;
while(ap_col<=(ap_mat+(MAXCOL-1)))
{
ap_ren=ap_col;
while(ap_ren<=(ap_mat+(MAXREN+MAXCOL-1)))
{
*ap_ren=0;
ap_ren=ap_ren+MAXCOL;
}
ap_col=ap_col+1;
}

}
Sep 18 '07 #1
3 1391
dperren
10 New Member
void ini_colmatdin (int *)

You're missing a semicolon.
Sep 18 '07 #2
thalinx
4 New Member
oh thanks this thingss happen =S
Sep 18 '07 #3
dperren
10 New Member
No worries, I just spend 10 minutes wondering why:

void void(main){
}

wouldn't compile!
Sep 18 '07 #4

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

Similar topics

1
3331
by: Steve | last post by:
I just spent waaaaaaaaaaaayy too much time trying to track down an error that was incorrectly reported just now, and I would like to see if someone can explain to me why it was reported that way. ...
1
3221
by: Donald Canton | last post by:
Hi, I'm using Bjarne's book to learn C++ and am stuck on the Calc program in Section 6. Everything works fine except when I try to use istringstream to parse a token from the command line. I...
5
4474
by: r.nikhilk | last post by:
Hi, Currently, we are porting C++ applications from 32 bit to 64 bit on AIX platform. (The current version of AIX is 5.3 and xlC verison is 8.0). We are able to compile the applications by...
2
2246
by: david | last post by:
Anyone could give me a hand about this syntax error? Thank you. David Source Code: Dim conn As New SqlConnection(strConn) Dim daAngio As New SqlDataAdapter(strSelectStatement, conn) 'Create a...
3
16192
by: Manuel | last post by:
I'm trying to compile glut 3.7.6 (dowbloaded from official site)using devc++. So I've imported the glut32.dsp into devc++, included manually some headers, and start to compile. It return a very...
1
2212
by: Hari Sekhon | last post by:
I've written an except hook into a script as shown below which works well for the most part and catches exceptions. import sys def myexcepthook(type,value,tb): do something ...
7
1824
by: Josh | last post by:
I have a lot of except Exception, e statements in my code, which poses some problems. One of the biggest is whenever I refactor even the triviallest thing in my code. I would like python to...
7
2866
by: bryant | last post by:
Hi all. I am new to ASP and working in Expression Web. The following query displays the information I need in the gridview for a single record. SELECT "OE_HDR"."ORD_NO", "OE_HDR"."CUST_NAM",...
6
37999
by: muby | last post by:
Hi everybody :) I'm modifying a C++ code in VC++ 2005 my code snippet void BandwidthAllocationScheduler::insert( Message* msg, BOOL* QueueIsFull,
5
4006
Banfa
by: Banfa | last post by:
So I have a little problem, I have a template class and that class contains a template function; now what I want to do is declare that function in the class (or indeed the entire class) as a friend...
0
7135
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7410
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5650
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
440
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.