19,876 Topics

Member Avatar for
Member Avatar for lostinC

This program needs to create, sort, and search a novel array. Each novel in the collection will have the following attributes: Title Author Publishing Year Number of Pages The novels I will be sorting are in a file called data.txt I need to use bubble sort to sort the array …

Member Avatar for nucleon
0
137
Member Avatar for mastermosley

I have the function AddToText which is located in the Form1 Partial Class [code] public void AddToText(string text) { this.txtStatus.Text = this.txtStatus.Text + "\r\n"; } [/code] I want to call this from a different class so I do: [code] Form1 frm = new Form1(); frm.AddToText("Test"); [/code] I click a button …

Member Avatar for mastermosley
0
3K
Member Avatar for NavidV

Hi guys, I have a question regarding C++ classes and polymorphism. I understand the concept of pointers and that polymorphism with respect to operators(+, -, etc...) means that the operators can have different meanings based on "context" (how they are used). My question is regarding class pointers. For example, if …

Member Avatar for ArkM
0
96
Member Avatar for superpc2525

I have made a game on c++. Can any one help me to improve it (by adding graphics) and making code short. [code] #include <iostream.h> #include <conio.h> #include <time.h> #include <dos.h> void main() { clrscr(); int i,a=21,b=0, c[5]={0,4,3,2,1},z; char x=15; cout<<"\n\n\n\n\n\t\t\t\t\t\t\tWelcome"; cout<<"\n\n\nRules:\n\n"; sleep(1); cout<<"1. There are 21 match sticks between …

Member Avatar for siddhant3s
0
288
Member Avatar for nexusdarkblue

Hi everyone, It seems my struggles with structures have continued. In my current program, I'm trying to pass an array of structures into a function. I've declared my structure in a separate header file using [B]typedef [/B]to define a new type called 'flight'. But when I try to compile my …

Member Avatar for nucleon
0
240
Member Avatar for Ganahonic

[CODE]#include<stdio.h> int function() { int test1; int test2; addit(test1 + test2); return(0); } void addit(test1 + test2) { printf("Sum is: %d",test1 + test2); }[/CODE] Whenever I define a void function in C with an operator in the parameters, I always get the error: error: expected ')' before '+' token How …

Member Avatar for Dewey1040
0
82
Member Avatar for dirbax

Hi , is it possible to transform the following code to math [code=cplusplus] int F( int n ) { int r=0; int mid=n/2; for( int i=0 ; i<n ; i++) { if( i<mid) r+=1 ; if( i==mid) r*=2 ; if( i>mid) r=pow(r,3) ; } return r ; } [/code] and …

Member Avatar for Rashakil Fol
0
122
Member Avatar for Dewey1040

i half understand this code, just wondering if anybody could give me helpful tips/hints about understanding the difference between these two functions [code=C] extern status traverse( list L, status ( *p_func_f )() ){ if( empty_list ( L ) ) return ( OK ) ; if( ( *p_func_f ) ( DATA( …

Member Avatar for Ancient Dragon
0
104
Member Avatar for sayeediqbal

Dear All please read below my test C code. The ins_inv() picks Value of :cds but did not pick :xyz value though it is populated in find_sp_inv() function. [code] varchar cds 11; varchar xyz 30; varchar fxo 11 main(argc, argv) int argc; char **argv; { find_sp_inv (); ins_inv(); } find_sp_inv() …

Member Avatar for Narue
0
80
Member Avatar for NRaf

I was wondering if the following fuction is a safe way to get input from a user (with a specified length). [CODE=c]char *input(int inputSize) { char str[inputSize + 2]; /*DO STUFF HERE (i.e. GET INPUT, CHECK IF CODE IS CORRECT, ETC*/ return &str[0]; }[/CODE] Is there anything that can go …

Member Avatar for Narue
0
110
Member Avatar for ScienceNerd

I just started studying structured programming and I was trying to do a If Else then function but the compiler won't let me compile it? #include <iostream> using namespace std; int main (void) { int age; cout << "Enter your age" << end1; cin >> age; if(age > 21) { …

Member Avatar for charleen
0
116
Member Avatar for riahc3

Hey In VS, you can in a struct do: [code] struct test{ int tes; }tt; [/code] then when I put tt., it would display the all fields in a tooltip which in this case would display tes. Is "IntelliSense" (I know it is not called that) in wxDev-C++?

Member Avatar for mitrmkar
0
122
Member Avatar for Digvijaysinh

Hiii I am developing one window application in c# and .net with sql server 2005 as database. now, i have Four questions: 1] I have one dropdownlist in form and i want to fetch the content/data of table category in to this dropdownlist and when I run this form on …

Member Avatar for LizR
0
114
Member Avatar for tksrules

Hi, I am comfortable in c.But i find errors here in my code.I know its related to that structures cant be accessed outside main().Need s use of pointer.How to do?.Help me soon. A revised code will be of help. [code=c] #include <stdio.h> #include <string.h> struct phonebook { char name[100]; long …

Member Avatar for John A
0
103
Member Avatar for death_oclock

I had forgotten about calloc for the longest time, but I was recently reminded of it. Now i'm curious, what would be the difference between [ICODE]malloc(numElems * elemSize);[/ICODE] and [ICODE]calloc(numElems, elemSize);[/ICODE]? If my knowledge of arrays is correct, there shouldn't be any difference in the memory allocated.

Member Avatar for death_oclock
0
137
Member Avatar for codeman85

This program needs to create, sort, and search a novel array. Each novel in the collection will have the following attributes: Title Author Publishing Year Number of Pages The novels I will be sorting are in a file called data.txt I need to use bubble sort to sort the array …

Member Avatar for ArkM
0
95
Member Avatar for Lilal

Heya, Just trying to get a little help on some excercises I need to do, Done 14/15 fine, but stuck on 15th and not sure quite whats wrong. Need to do a systemcall from C program to copy a file, using stat, open, read write and close. So far I've …

Member Avatar for Lilal
0
99
Member Avatar for me_ansh

Hi all, I want to find the size of proc file using C....can somebody help!!!!

Member Avatar for MosaicFuneral
0
122
Member Avatar for karthik.c

hi guys i've problem in tcp:client/server program when i run it: this program is to print the contents of a file in other m/c connected to LAN im sure that i've given the correct IPAdress,and also path of the file in other m/c but still its not printing the contents …

Member Avatar for Ancient Dragon
0
182
Member Avatar for yuvaraj.tr

Hi friends i am doing the snake game program for Set top Box . I am Facing problem when i get the remote control keys. if i press the up,down,right,left keys when program is running ,program does not response .once game is over then it is taking the values from …

Member Avatar for nucleon
0
102
Member Avatar for raj_mah
Member Avatar for pinky yohana
Member Avatar for jam123

Hi everybody, Im a new member on this forum and I want ur help on C language. Im a new student on this language & mostly we study it by our-selves. This is the question: > One of the academic staff is trying to keep track of the students and …

Member Avatar for Alibeg
0
146
Member Avatar for vishy_85

hi all, im having some problem , returning the buffer array to the main function, im new at this , i need to print the currentdate from the main function, is thr any way i can return the date to the main function ?? [code] #include <sys/time.h> #include <time.h> #include …

Member Avatar for Narue
0
100
Member Avatar for leebria

Newbie to C programming here. I am trying to convert a char array into individual hex values and store them in an unsigned char array. Basically I have "3www6google3com0" and I would like to get the 8 bit hex value for each individual character from the string. I would like …

Member Avatar for leebria
0
1K
Member Avatar for pete08

Hi, does anyone knows how can I create POP3 server (not client) in C#. I'm not talking about downloading some commercial solution, but developing new one. Pete

Member Avatar for miculnegru
0
91
Member Avatar for deepugtm

I want to write a program that can run a file in my hard disk.For example,a test.bmp file is there in location D:\home\test.bmp,that program should open(like double clicking on it ) that file (test.bmp) and i can view the image contained in the file.

Member Avatar for csurfer
0
138
Member Avatar for fmylife

Ok so I have to turn in this C program today that is able to selectively sort a list of names from an input file, but when I compile it and run it, it doesn’t sort it correctly. Can anyone please help me here? I’m losing my mind to my …

Member Avatar for csurfer
0
103
Member Avatar for saphira

Hello guys, i'm trying to write a menu for a C program that should implement a bank system but i'm having problems with my code... I have tried to follow the example that my tutor gave on her lecture presentation, but to be honest i don't think i'm on the …

Member Avatar for Salem
0
4K
Member Avatar for aarti_gehani
Member Avatar for nucleon
0
74
Member Avatar for aarti_gehani

hi... i actually want to read the raw file(CR2 file) of jpeg image using turbo C... i m confused regarding the lib to be used and variable initialization i.e. do i need to define structure or array having pixel size... plz help its urgent...

Member Avatar for Ancient Dragon
0
125
Member Avatar for hellIon

i am using pelles c y am i getting these errors ? something wrong wid the winbase header file?? if yes then can u tell me from where should i download another one [code] #include<windows.h> main() { WinExec ("C:\\Windows\\Notepad.exe"); } [/code] C:\Program Files\PellesC\Include\Win\basetsd.h(17): error #2001: Syntax error: expected ';' but …

Member Avatar for Ancient Dragon
0
394
Member Avatar for ZeRo 00

Hiiee der..guyss i wud be gratefull if some1 can help me to sort this bit of my programme. In the shell that i am writing I need to use cd command...(move around the path specified ..das wat i think it does in linux) I have no idea how to get …

Member Avatar for Ancient Dragon
0
84
Member Avatar for MK12

Ok, so I have a project that I've written in Python(Actually it's not done yet), its the card game "Cheat" that you play in the command prompt with (until I learn wxPython -- GUI for Python) with computer players (or other people with you). I want to distribute it later, …

Member Avatar for MK12
0
172
Member Avatar for chriscross86

hi, there, im doing a small program and the output should be as below @ ** @@@ **** @@@@@ Ive coded it, but it gives different answers..please help.the code is as below. #include <stdio.h> int main() { int i,j,k,m,a,y; for(k=1;k<=3;k++){ for(j=1;j<=5;j++){ for(i=1;i<=j;i++){ printf("@"); } printf("\n"); for(i=1;i<=j+1;i+=1){ printf("*"); } printf("\n"); } …

Member Avatar for srikanthkadem
0
88
Member Avatar for koushal.vv

Hi, i just need to know is there any method in MFC / C++ which will do the validation for the entered date. ie if the date 12/11/2008 is given as input it should return saying the date is valid.i hope there exsists some standard function. it should also check …

Member Avatar for John A
0
510
Member Avatar for geemicah

[ICODE]#include<stdio.h> #include<conio.h> struct record_ko {char name[20]; int stno; char fav_color[20]; }record[5]; void main() {clrscr(); int no; for(int i=0;i<5;i++) {printf("\nwhats your name? "); scanf("%s",record[i].name); printf("what is your student number?? "); scanf("%d",&record[i].stno); printf("what is your favorite color? "); scanf("%s",record[i].fav_color); } for(i=0;i<5;i++) {printf("\nname:%s\t\t\t \nstudent no:%d\t\t\t \nfavorite color:%s\t\t",record[i].name,record[i].stno ,record[i].fav_color); } getch(); }[/ICODE]

Member Avatar for death_oclock
0
75
Member Avatar for JameB

Hello, I have a problem where I need to delete any occurrence of "~" from a string. I created a function but in the end, it only deletes half of the "~" and leaves the other half.... [code=c++] string goodstring(string inp) { for (int i = 0; i < strlen(inp.c_str()); …

Member Avatar for GDICommander
0
134
Member Avatar for slimjimmer

Hi, I am trying to validate user input from the scanf function. I have managed to ensure the input is an integer between the limits of 2 and 1000, but I haven't managed to get the program to only allow one value at input. Can I do this with scanf …

Member Avatar for Salem
0
2K
Member Avatar for mishu1516

hello dani........ plz help to get the following output using C language(array) using one nested for loop ******* ***** *** * *** ***** ******* plz...........help........quick

Member Avatar for jenilgandhi
0
234
Member Avatar for revenge2

hey guys how would i print something 60 times without actually typing the character out 60 times. [CODE=C]printf("#"*60);[/CODE] ^ which is complete rubbish and doesnt work, but what is the syntax for it? cheers!

Member Avatar for Aia
0
134
Member Avatar for jenilgandhi

plz help me... to Write a ā€˜C’ program to analyse multiple lines of text. First enter and store all lines of text. Then determine the number of vowels,consonanats,digits and whitespaces. Finally determine the number of vowels per line, consonanats per line and so on. Execute the program in two different …

Member Avatar for Aia
0
104
Member Avatar for cool1_best1

If the stack top is maintained at the [B]end of the linked lis[/B]t, i.e. stack top is the last item, accessing the stack top would take a lot of time, since N items of the linked list need to be traversed before we can access the last item, This would …

Member Avatar for death_oclock
0
105
Member Avatar for swetharvss

The description of my problem is here- Suppose I have an array of arrays- 1.1) 23445 1.2) 2144 1.3) 77988 1.4) 545 1.5) 52358 2.1) 2356 2.2)7878 2.3)531 2.4)78 2.5)78090 3.1) 578689 3.2) 90877 3.3) 1345 3.4) 422 3.5) 64 ..... .... ... Now i need to compare 1.1 , …

Member Avatar for death_oclock
0
114
Member Avatar for usman_minhas

Dear All, I am Usman doing my masters in networks. Currently i am working on a project and needs some help regarding the ethernet frame forwarding on different segments. I would like to ask that does any body know about such code which forwards the frame from one ethernet segment …

0
41
Member Avatar for abhi_marichi

I need to execute some dos commands like executables(.exe) PLEASE HELP ME OUT OF THIS

Member Avatar for Narue
0
139
Member Avatar for slimjimmer

Hi. I need to make a program which outputs an array to a file. The output file needs to have two columns, one labeled m(e) another labeled v, but I can't get the columns of the array to be separated in the output file, it just prints a string of …

Member Avatar for csurfer
0
158
Member Avatar for Sky Diploma

Hi All, I have taken up this home project just for my pastime. My objective is to take a html file and then make a complete new webpage with a specific keyword. It basically is a find and replace type of method where my existing file contains a specific keyword …

Member Avatar for Sky Diploma
0
210
Member Avatar for hellIon

[code] #include<stdio.h> void main(int argv,char * argc[]) { int num1,num2; num1=(int)argc[1]; num2=(int)argc[2]; printf("%d\n",num1); printf("%d\n",num2); } [/code] wat output should i expect? is there something wrong wid this code? cus i am getting weird outputs

Member Avatar for Narue
0
156
Member Avatar for gayatridas

[QUOTE=Kerry;41762][COLOR=Blue]Hello, my name is kerry and i just sign up .Well, my question is how do reverse a number input by user using recersive function.Thanks for the help. [/COLOR][/QUOTE] I have a sequence of 5 numbers. I want to write it in reverse order. Could you please help me that …

Member Avatar for moonw3ll
0
139

The End.