19,876 Topics

Member Avatar for
Member Avatar for wayne.nishant

C Program - to accept 'n' strings from user and store it in a char array I am currently using Turbo C++ Version 3.0 (one with blue screen) Can any one help with the C Code of the subject ?

Member Avatar for Daemon_CC
0
2K
Member Avatar for DkgMarine

So i'm new to C and i have a problem with struct, so when i run the program it goes to the_struct2 asks for first name and thats it. why does it stop working? is there a way to make the code more efficient? and is there a way to …

Member Avatar for Banfa
0
262
Member Avatar for Pilot122x

I need to find out how to cut text and insert text into a textfile.....I know about StreamReader and StreamWriter but i dont think any of these will do unless theres some method in the class that I dont know about. I want to be able for example read from …

Member Avatar for Bandarigoda123
0
562
Member Avatar for DkgMarine

hey guys, so i get the "c incompatible types in assignment" error in the malloc line. would someone please explain where i went wrong? Thank you in advance. #include <stdio.h> #include <stdlib.h> struct the_struct { char FirstName[20]; char LastName[32]; int Score[20]; }; int main () { int i,n; struct the_struct …

Member Avatar for DkgMarine
0
2K
Member Avatar for kent.johnstone_1

Hi, I'm getting an error that says my defined constant is not a function. It's not supposed to be a function. This is the error... Tick.c:389:35: error: called object '200000000ul' is not a function It points to... #define TICKS_PER_SECOND ((GetPeripheralClock()+128ull)/256ull) GetPeripheralClock has the error. It comes from... #define GetSystemClock (200000000UL) …

Member Avatar for kent.johnstone_1
0
252
Member Avatar for ddanbe

Don’t know if this is ever been done before, or even if it is a good way to do it. I’ll just await your comments if any. What I mostly found on the web is that if you want to define a polynomial you need to have an array containing …

0
450
Member Avatar for cambalinho

the WindowClass.hbrBackground=(HBRUSH) CreateSolidBrush(RGB(0,255,0)); change the all windows backcolor, registed with these class(WindowClasss). and for change the DC\window backcolor we need use WM_ERASEBKGND or other messages for do it(i don't remember how). but the SetDCBrushColor() do the job, right? but seems be ignored :( i'm using it in WM_PAINT messages. can …

Member Avatar for cambalinho
0
798
Member Avatar for naveen1993

#include<stdio.h> #include<conio.h> #include<graphics.h> #include<dos.h> void base() { int k,l; for(k=0;k<20;l=l+16,k++) { rectangle(100+l,400,116+l,418); //square box line(107+l,418,107+l,413); //middle down to up line line(107+l,413,100+l,409); //middle to left side line(107+l,413,112+l,400); //middle to up side rectangle(100+l,418,116+l,436); line(107+l,436,107+l,431); line(107+l,431,100+l,427); line(107+l,431,112+l,418); } } int main() { int gd=DETECT,gm; int i,j,k,l,ch1,ch2,x=90,y=389; initgraph(&gd,&gm,"c:\\tc\\bgi"); //base(); ch1=getch(); while(ch1==32) { base(); if(ch1!=32) …

Member Avatar for naveen1993
-1
128
Member Avatar for pinkamech

Hi, I am currently working on a UNO Game using C++ and I am facing some troubles. I need to use Vectors and Pointers (for the main bulk for this assignment). I am wondering if anyone could kindly help me because the deadline is on Wednesday and I feel very …

Member Avatar for pinkamech
0
5K
Member Avatar for cambalinho

the DrawText() function is for draw text with a rectangle size. but if the DT_VCENTER is used with DT_SINGLELINE, how can i use the "\n" and "\t" strings formats?

Member Avatar for cambalinho
0
291
Member Avatar for Bungie

Hello I'm working on this final project. I need to create an ATM program with a unique pin code. However every time I run the p I have done 3 hours of researching and I've decided to just ask. What am I doing wrong that it's just running the do …

Member Avatar for Ancient Dragon
0
286
Member Avatar for rao naeem
Member Avatar for Stavros_1
0
268
Member Avatar for Dagmawit

how to write the fibonacci series by accepting the value of terms of the series from the user?

Member Avatar for danyal baig
0
153
Member Avatar for nhiap6

Could someone please sum up all the information or give me a link to a website why C++ is used for system programming. Ok, am realy on deadline for finishing my last highschool paper and I know this sounds like a homework question but I look it up on web …

Member Avatar for NathanOliver
0
187
Member Avatar for Twee Nguyen

I have a problem with the error "cannot convert from 'int' to char[][] ". I check it for many times but I do not know how to fix. I just start with C. Could you help me, please? The error in the lines 23, 25, 28, 32, 64. I would …

Member Avatar for Stavros_1
0
1K
Member Avatar for Prithvi.R.K

Hi, i'm trying to write a c code for finding height of silhouette at every given [oint of x using brute force can any one help me out please. Thank you

0
70
Member Avatar for Yimeng

I've learned the hello.c using FUSE. It can create a hello file under mountfile. But I've no idea about how to create a folder under the mountfile and then create hello under mountfile/folderIcreate. then I can use cat mountfile/folderIcreate/hello the code is similar to the simple hello.c. #define FUSE_USE_VERSION 30 …

Member Avatar for Yimeng
0
360
Member Avatar for nekoleon64

My Name is Leonard E. Norwood Jr. I'm Undergraduate student from Norfolk State University in Norfolk Virginia. Getting down to the point, my program is supposed to print out a list of pre-set numbers in reversal. I used pointers for this, however, something went wrong so I'm trying my best …

Member Avatar for iamthwee
0
375
Member Avatar for Netcode

#include <stdlib.h> #include <string.h> int main(int argc, char *argv[]) { char *first, *second, *third; first = malloc(888); second = malloc(22); third = malloc(22); strcpy(first, argv[1]); strcpy(second, argv[2]); free(first); free(second); free(third); return(0); } Like I said before, I need help learning C and trying to figure out my errors. With this …

Member Avatar for deceptikon
0
206
Member Avatar for Que336

C# Interview tomorrow Hello fellow programmers. I know this doesn't have anything to do with code but I really need some advice. I have a .NET(C#) interview tomorrow for a junior vacancy. The problem I have is that all my experience is based on PHP. I have a good understanding …

Member Avatar for deceptikon
-1
311
Member Avatar for Netcode

Am trying to write a c program to do the following; • Write on the screen: ``Please enter a positive number: ''. • Accept a number from the user. • Keep prompting for more numbers until -1 is entered • Output the sum of all entered numbers excluding -1. • …

Member Avatar for Ancient Dragon
0
168
Member Avatar for Netcode

Hi all, trying to read up on C to get acquainted with the language. Got an exercise am trying to answer and i may need your help to know if am right. I have this code as below, and am asked, what lines have buffer length checking errors. int main( …

Member Avatar for Netcode
0
299
Member Avatar for Jephthah_1

i need a C program to enter user info. and calculate cost ... a program like a point of sale (POS) system

Member Avatar for rubberman
0
77
Member Avatar for bumsfeld

A simple program to show you how to create a table of Fahrenheit and Celsius values using a for loop. You may be able to learn from this code.

Member Avatar for rubberman
1
280
Member Avatar for ravi_14

IplImage *in; CvMemStorage *storage = cvCreateMemStorage (20506); CvSeq *contours=NULL; CvPoint *PointArray=NULL; for() { //image processing and feature extraction code here cvClearMemStorage (storage); //clear memory area free (PointArray); cvReleaseImage (&in); } At the end of each iteration i ma releasing memory but still i get memory shortage error after # processing …

Member Avatar for rubberman
0
334
Member Avatar for jamesc205
Member Avatar for mike_2000_17
0
456
Member Avatar for cambalinho

i'm learning win32 from Programming Windows Fifth Edition book, but i need ask something about these code: /*−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− SCRNSIZE.C −− Displays screen size in a message box (c) Charles Petzold, 1998 −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−*/ #include <windows.h> #include <tchar.h> #include <stdio.h> int CDECL MessageBoxPrintf (TCHAR * szCaption, TCHAR * szFormat, ...) { TCHAR …

Member Avatar for cambalinho
0
365
Member Avatar for COKEDUDE

Can someone please explain this error and how to fix it? This worked perfectly on my computer but it stopped working when I transferred it to another computer. int hash = 0; char *strings[100]; if((int)strings[i] != 0) if((int) strings[hash] != 0) while((int) strings[hash] != 0) if((int)strings[hash] != 0) if((int)strings[hash] != …

Member Avatar for Ancient Dragon
0
559
Member Avatar for COKEDUDE

I know this is how you read from a file. I also want to print my output to the same name of the file plus ".txt". So if my file is called "text" I want to print it to a file called "text.txt". #include <stdio.h> #include <stdlib.h> #include <stdbool.h> int …

Member Avatar for Ancient Dragon
0
336
Member Avatar for COKEDUDE

What does creating a pointer of a function do? I'm not used to getValue being a pointer. char* getValue(char* string); I'm used to something like this. char getValue(char* string);

Member Avatar for sepp2k
0
124
Member Avatar for ايمان_2

It is possible to use any number of characters '/' as a delimiter in path instead of one traditional '/'. For example, strings //usr///local//nginx/sbin// and /usr/local/nginx///sbi n are equivalent. The character '/' (or some sequence of such characters) at the end of the path is required only in case of …

Member Avatar for Ancient Dragon
0
540
Member Avatar for PESOF

hello everyone i was wondering if you guys can help me.. i am really tired i havent slept for 2 days trieng to figure out how to do this i am a begginer in this and my prof asked me a game which is http://www.miniclip.com/games/fat-slice/en/ he wants it in c …

Member Avatar for iamthwee
0
313
Member Avatar for Stefan_2

I need to write a code that is gonna remove a whole row/column in a matrix(either static or dynamic matrix)

Member Avatar for Ancient Dragon
0
394
Member Avatar for ravi_14

i am not able to connect to the sql server on my system. SqlConnection^ connection=gcnew SqlConnection(); connection->ConnectionString ="Data Source=blueboy\sqlexpress;Initial Catalog=DCV_DB;Integrated Security=SSPI;Pooling=False"; i got the string from database properties.(i have attached the same in this post) sql service is running. tcp ports are enables too.

0
115
Member Avatar for ishaan3731

i have this code which tries to enter data into an array of string(char ptr) called token.To do this i have used a while loop to obtain a string as user input and put that string into the token array one by one. But when i try to print the …

Member Avatar for ishaan3731
0
202
Member Avatar for rob2

Hi guys I have OS of the WB150F camera. you can download it here: https://www.mediafire.com/?jmshouy4c937yw3 I have several question about it: 1- What do these files do? MakeAv, MakeAvf, sde6 and all files in the "Tools" folder 2- What is the usage of the "brcz.h" file (in this address: \ip\include)? …

Member Avatar for iamthwee
0
172
Member Avatar for Bchandaria

i want a full code for finding different ways to climb the n-stair case problem that is each step is either 1 or 2 stairs. Eg- a 3-stairs staircase can be climbed in 3 ways :1-1,1-2,2-1. Using subset method can any one can help me out for this problem?

Member Avatar for iamthwee
0
193
Member Avatar for fadoua_1

Hi, I created a structure Vector and implement some functions to make the new defined type (vector) dynamically allocated and resized (inspired from the C++ implementation of the dynamic arrays : vector). I need to assign a structure to every vector element but I am not sure that I am …

Member Avatar for Ancient Dragon
0
387
Member Avatar for vishalonne

Hello Does every function in C++ returns value? If yes what is that value and what is the use?

Member Avatar for Learner010
0
231
Member Avatar for rory.starkweather.7

This is a trivial program in Turbo C 2.01. It is intended to show that C can do arithmetic with mixed data types, and what the results are: #include <stdio.h> void main(void) { int num1 = 5; float num2 = 2; int num3; num3 = num1 / num2; printf( "%f\n", …

Member Avatar for rory.starkweather.7
0
155
Member Avatar for agrbinoo.albaker

Write a complete C++ program that reads the attached file (values.txt) to find and print the following: a. The average value of the numbers in the file. b. The maximum and minimum value c. The count of negative and positive values (ignore zero) #include <iostream> #include <cstdlib> using namespace std; …

Member Avatar for agrbinoo.albaker
0
301
Member Avatar for Bchandaria

Starts with 2 uneqaul positive numbers on the board. 2players move in turn to write on board a positive number equal to the difference of any 2 numbers already written on the board. the new number written on the board should not be repeated. the player who can not write …

Member Avatar for Ancient Dragon
0
120
Member Avatar for beastie805

I got a small program here, I am just trying to return a string value from a function through a reference parameter but I keep getting an error. Any help or tips will be appreciated #include<iostream> using namespace std; int timesTen(int, string&); int main() { int number = 6, product; …

Member Avatar for beastie805
0
451
Member Avatar for inspire_all

#include<stdio.h> #include<conio.h> int main() { char cyp[150],eng[26]; scanf("%s",eng); gets(cyp); getch(); return 0; } eng is accepted but only one letter is accepted for cyp.

Member Avatar for rory.starkweather.7
0
389
Member Avatar for Aditya_8

gimme the error plz it says undefined symbol _main in module c0.asm #include<iostream.h> class largest { private : int num1,num2,num3,big; public : void enter(int a,int b,int c); void max(void); void display(void); }; void largest::enter(int a,int b,int c) { cout<<"Enter numbers n"; a=num1; b=num2; c=num3; cin>>a>>b>>c; } void largest::max(void) { big=num1; …

Member Avatar for Ancient Dragon
0
167
Member Avatar for Jaks_maths

This Program prints the numbers in given array(Row-Major Order) in Spiral order. Ex: Order Is 3*4 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 Spiral Order Of Matrix is 11 12 13 14 18 22 26 25 24 23 19 15 16 …

Member Avatar for rubberman
0
296
Member Avatar for glao

Hello , I have the following code : int a = 2; int *ptr = &a; int *second = &a + 1; printf("\n ptr = %p\n", ptr); printf("\n second = %p\n", second); which just prints the address of pointers and the address of second is 4bytes next the ptr. Output: …

Member Avatar for glao
0
187
Member Avatar for parth2911
Member Avatar for SerenityG

Hello, I have this program that runs in C++ that I need to run in C. This is my program in C++: #include <iostream> #include <string> #include <cctype> using namespace std; char encode (char plaintext) { if (isupper(plaintext)) { if (plaintext > 'M') { plaintext += 13; } else { …

Member Avatar for David W
0
236
Member Avatar for ferizhandi

hi all i want to open a file but this file in other directory.and i want to use this function: int open( char *filename, int access, int permission ); i can not use other function, because i have use only system call function. when file exists beside of my code, …

Member Avatar for naveen1993
0
249

The End.