19,876 Topics

Member Avatar for
Member Avatar for matt.malone.921

#include <stdio.h> main() { FILE*fp ; if ((fp = fopen("new.txt","r")) == NULL); { printf("file could not be opened\n"); return 0; } } this is what ive written and it always comes back with file could not be opened. I need to read the text file new, which has 10 variables …

Member Avatar for Sokurenko
0
90
Member Avatar for titusnainggolan

I have the code below #include <stdio.h> int main(){ float n; scanf("%f",&n); printf("%f",n); return 0; } Then, I run the code input: 45321.56 is not same with output:45321.558594 I want to get output which same as the input. How to solve this problem? Thank you

Member Avatar for WaltP
0
376
Member Avatar for system_Broken

I WANT SEND ITEMS INTO DATABASE WITH ONE TIME CONNECTION OPEN ? MYCONN.OPEN(); FOR(INT I =0; I < CODE.COUNT ; I ++) { DB.SUBMITITEMS(CODE[I]); //IS IT RIGHT IF I HAVE 100 ITEMS TO SEND DATABASE WITH ONCE TIME OPEN CONNECTION OF DATABASE; OR I NEED TO REOPEN AND CLOSE CONN …

Member Avatar for M.Waqas Aslam
0
146
Member Avatar for Vish0203

How can i give an icon to the exe file produced after executing my code?? is it possible??

Member Avatar for Vish0203
0
113
Member Avatar for dinohead

Hello! I have what I want to print to file current printf-ing on my console. Can I have some help getting it to do the same, only this time to file please. I can't get it to work. Many thanks for(i= 0; i <= k; i++) { add = (unsigned …

Member Avatar for deceptikon
0
160
Member Avatar for tonkata_stoilov

Absolutely new to C. I just downloaded Code::Blocks with MinGW and tried to build my first piece of code and I got this strange message: Linking console executable: bin\Debug\intro1.exe Execution of 'mingw32-g++.exe -o bin\Debug\intro1.exe obj\Debug\main.o' in 'D:\Documents\intro1' failed. Nothing to be done. And I don't know what to do. Any …

Member Avatar for gusano79
0
238
Member Avatar for chaacoali

Can someone please tell me what is wrong with this code int main() { char str[10],str2[10]; int k,i=0,j; printf("enter de string\n"); scanf("%s",str); k=strlen(str); printf("length of de string %d\n",k); for(j=k-1;j=0;j--) { str2[i++]=str[j]; } printf("%s",str2); for(i=0;i<k;i++) { if(strcmp(str,str2)==0) { printf("palindrome"); } } return 0; } this is my output enter de string …

Member Avatar for chaacoali
0
131
Member Avatar for rithish

i need c++ e-book that should have programs from hello world,addition to vectors,map.in all books they cover only the concepts and finish by 3 programs in a topic.i need a c++ book that covers more than 500 to 800 programs please suggest me a good book.

Member Avatar for moutanna
0
77
Member Avatar for lloydy76

Hi there, im new to c# and have been trying to create a calculator without a switch statement, using the operator 'op' as a variable, but i cannot get it to work, here is my current code: [code] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; …

Member Avatar for samsylvestertty
0
6K
Member Avatar for gem.gonzales.9

#include <stdio.h> #define p printf #define s scanf main() { int q,num[2000],sum,i,a,b; float mul,t,grade,quiz,d; { p("enter the the total quiz:"); s("%f",&t); p("enter the no. quiz:"); scanf("%d",&q); p("enter five no sepeerated by enter :\n"); for(i=0;i<q;i++) s("%d",&num[i]); sum=0; for(i=0;i<q;i++) sum=sum+num[i]; p("the sum of array :%d",sum); mul=sum/t; p("\ntotal:%f",mul); grade=mul*100; p("\n total is: %f",grade); …

Member Avatar for Vish0203
0
116
Member Avatar for KasmIR

Hello, I try to compilate this progam! It return "Error 4 error C2664: 'LoadLibraryExW' : cannot convert parameter 1 from 'char *' to 'LPCWSTR' c:\users\andrei\documents\visual studio 2010\projects\test\test\test.cpp 282 1 test Error 3 error C2664: 'LoadLibraryW' : cannot convert parameter 1 from 'LPCSTR' to 'LPCWSTR' c:\users\andrei\documents\visual studio 2010\projects\test\test\test.cpp 200 1 test …

Member Avatar for deceptikon
0
244
Member Avatar for rithish

#include <stdio.h> #include <stdlib.h> struct data { int n; }**value; int main() { int m,c=0; printf("enter the number: "); scanf("%d",&m); value[1]->n=m; for(value[2]->n=0;value[2]->n<=value[1]->n;value[2]->n=value[2]->n+1) { c=c+value[2]->n; } printf("%d",c); } it takes the value and compiler stops working

Member Avatar for WaltP
0
516
Member Avatar for SHASHWATH

I have used queue but I cant figure out how to write code to display horizontal(bfs) and vertical binary search traversal

Member Avatar for WaltP
0
209
Member Avatar for shkr

i have the log file with byte dump and also structures.. using byte data as input i need to print the values of structures in user readable format..can anyone post the code.. here is txt file.. 002c2a54:00000000 00001389 11950000 00000000 00000000 00002b74 0000011c 00000000 002c2a74:01010100 01000000 0e600384 00000000 00000384 00000000 …

Member Avatar for Sokurenko
0
295
Member Avatar for saranyak
Member Avatar for newbie1234
Member Avatar for Vish0203

Is there any way to create an installer using C programming..? I want embed all the files of a software created by me in an exe file, which will extract all the things to a desired folder or drive. I heard that we can make batch file(package).. but how to …

Member Avatar for Vish0203
0
254
Member Avatar for bestonearth

hello all the members, i'm new to .net and i want code for a window application in c# for entering the userid and password in windows form

Member Avatar for Mike Askew
-1
206
Member Avatar for rithish

#include <stdio.h> #include <stdlib.h> struct rithish { int roll; char name; }*s[20]; void main() { struct rithish *s; int i; for(i=0;i<2;i++) { printf("\n\n\t Enter roll : "); scanf("%d",&*s[i].roll); printf("\n\n\t enter name: "); scanf("%s",&*s[i].name); } } is it possible to do structure variable as pointer to array

Member Avatar for Schol-R-LEA
0
122
Member Avatar for rithish
Member Avatar for Karkalash

Hi All: I'm wondering if anyone knows any usefull links to articles I can read on coding multiplayer for XNA. I'm looking for something that would teach me how to code for more than two players. The idea of what I'm working on is for a standard 4v4 deathmatch over …

Member Avatar for jLocke
0
468
Member Avatar for hmagnum

while (HullShipA > 0 && HullShipB > 0 && HullShipC > 0) { // do whatever i wanna do } Console.Writeline("End Game"); So i'm kinda new to c# but here is the deal: In this simulation, ships attack eachother for damage and the way it is, as soon as 1 …

Member Avatar for hmagnum
0
116
Member Avatar for charles.haselden.3

I am trying to build a tic tac toe program for an assignment. My trouble is making a dynamic array, I am new to c and my understanding of pointers and malloc is still very limited. I would like a resource I could read or an explination of how malloc …

Member Avatar for deceptikon
0
270
Member Avatar for JamesWorth

Hi! I'm new in this forum. I was reading some other posts about Directx and so. Now I have a problem with Lightning in Directx. I wanted to do some graphics like minecraft's ones, with cubes. And when I got my cube class ready, i drawed one cube and that …

Member Avatar for DeeperShade
0
229
Member Avatar for idislikemacs

I'm done with my tic-tac-toe program, but now I want to ask a simple question to the winner of the match to make the victory absolute. Would I need a while loop? I also feel my code is too messy, how can I enhance/improve it? Thank you! #include <iostream> using …

Member Avatar for Ancient Dragon
0
315
Member Avatar for Perry31
Member Avatar for rithish
0
76
Member Avatar for dinohead

Basically how can I do it? The values I want to read (going to be writing to file later) are hex pairs meaning the values are stored across more than one address location. The first value is stored at pointer address 12feac, the next pointer is at 12feb0 So reading …

Member Avatar for dinohead
0
130
Member Avatar for Marcusflint

Hello, I just cant figure out why i get this output. When i run this program, i get the output as 11 11 11, how ? shouldn't it be 11 10 10 ?? Please explain... #include<stdio.h> #define MAX(x,y) (x)>(y)?(x):(y) int main() { int i=10,j=9,k=0; k=MAX(i++,++j); printf("%d %d %d",i,j,k); } Thanks!! …

Member Avatar for rithish
0
173
Member Avatar for rithish

#include <stdio.h> #include <stdlib.h> struct student { char name[15]; long int regno; struct employee { char name1; int rollno; struct student s1 }s1; }s2; void main() { struct student s1={"rohinn",2345} prntf("%s",s2.s1.name); } error at line 12

Member Avatar for rithish
-1
162
Member Avatar for sridevi boya

The folders contains different images in them and the file names may match from those 2 folders and we should be able to display those images in 2 picture box having the same file names randomly. Using C# visual studio 2010. Please help me out with this code....!

Member Avatar for Cameronsmith63
0
209
Member Avatar for ZeQuia

I have a question, how can i use two different sets else if statements that will work properly? i tried it normally but the second set of else if statements dont work at all. please help. thanks

Member Avatar for teachMyself
0
131
Member Avatar for teachMyself

I am trying to learn C and have written a simple program that accepts the string from user and prints it. Would you loke to suggest me anything on my practices? I need to learn it very well. so please help me improving myself. Here goes my code: //Dynamic Array …

Member Avatar for WaltP
0
271
Member Avatar for pooh1234qwerty

char str[]="qwerty"; char *p="qwerty"; str++; \\error *str='a'; \\works p++; \\works *p='k'; \\error whereas, char str[]="hello"; char *p="hello"; str="tell";\\ error p="tell"; \\works strings point to themselves like arrays then why is str="tell"; \\error an error?? is the case same for arrays?? please explain the reason for every line. also, why can't …

Member Avatar for deceptikon
0
125
Member Avatar for shanki himanshu

#include<iostream> #include<conio.h> using namespace std; struct node { int info; node *left,*right; }; int main() { struct node *root; root=NULL; //root->info=NULL; //root = (struct node*)malloc(sizeof(struct node)); if(root==NULL) //cout<<root->info; cout<<root->info<< " "<<root->left<<" "<<root->right<<"\n"; getch(); return 0; } why it is giving an error?

Member Avatar for MonsieurPointer
0
92
Member Avatar for gem.gonzales.9

think a program that you can combine decision ,looping,recursion,array and function i find it hard to think a program that you can incoperate it all.

Member Avatar for deceptikon
0
105
Member Avatar for finston

I am using Code::Blocks and mingcc to produce an executable from some heritage c code circa 1998. Compiles OK. Linking problems. Even though I can use the Code::Blocks IDE to see where the parameters are declared in header.h files and implemented in main code c files, I get "undefined reference" …

Member Avatar for deceptikon
0
281
Member Avatar for RReddy1

2012-08-01 20:57:32.547,ERROR,AuthenticateMethod/4, Response code=M2 2012-08-01 20:57:33.053,INFO,PaymentMethod/3,PAYMENT Response Code=0001 Hi, I have a file containing comma seperated text as above. i need to parse this text and count how many times "AuthenticateMethod/4" and "PaymentMethod/3" these methiods are present in the file. Can you please help me in this regard? Regards,

Member Avatar for Perry31
0
196
Member Avatar for amezn

Hi, i want to know the code which will detect the same number in an array in quick sort program using C, for Eg: if the push element has a 56 of number while i enter the same number 56 in an array it should show the printf statement... i …

Member Avatar for Ancient Dragon
0
68
Member Avatar for starkk

#include<stdio.h> #include<stdlib.h> int input(int *a) { int n,i; printf("enter the no of elements:"); scanf("%d",&n); for(i=0;i<n;i++) { printf("enter the element:"); scanf("%d",a++); } return n; } int key_input(int *a,int key) { int k; printf("enter the key value which have to be searched in the array of no's provided:"); scanf("%d",&k); return k; } …

Member Avatar for Ancient Dragon
0
194
Member Avatar for I_m_rude

hi... Can you please help me by giving only some HINTS of algorithm used to solve this. I AM NOT ASKING ANY CODE OR SNIPPET FROM ANYONE. I just want hint or algorithm to use... There is a linked list where some nodes have similar number. Sort them such that …

Member Avatar for I_m_rude
0
156
Member Avatar for vickymehta6789

Hello friends, for the last couple of days i am having problems with STL programming. I have 2 compilers Borland and Eclipse (both latest versions) and i cant program with STL in either of these. I write simplest of programs of STL(vector and list), the program gets compiled with no …

Member Avatar for sepp2k
0
106
Member Avatar for sridevi boya

C#: I have two folders first one containing various images of the tops and other containing various images of bottoms, now randomly a dress(top & bottom) should be selected such that if user inputs no of days the dresses should not be repeated, those dresses which are not worn should …

Member Avatar for Mike Askew
0
220
Member Avatar for ZeQuia

**good day to all! i have a project all about color guess game. i just want to learn about using random functions in words because usually i only see random numbers. anyone can help me to create a source code that will randomize words? thank you! turbo c only.**

Member Avatar for Flowerlady
0
156
Member Avatar for nida.lodhi.7
Member Avatar for devender22

i want to know why the runtime error is coming in this code????? #include<stdio.h> #include<conio.h> #include<string.h> int main() { char *a,*b; scanf("%s",a); printf("%s",a); return 0; } there was no error when a declared first pointer i.e. a but as soon as i declared the 2nd pointer(b) i am getting a …

Member Avatar for Ancient Dragon
0
122
Member Avatar for ROSS679

I am working on a program that updates a Database via ASP.NET (C#) using Microsoft Access and OleDb and have the following problem when loading my web form in FireFox: *"The INSERT INTO statement contains the following unknown field name: 'txtCustomerID'. Make sure you have typed the name correctly, and …

Member Avatar for ROSS679
0
138
Member Avatar for dotun.esanoluwa

I am having a weird problem with this code. I keep getting this error. "NullReferenceException was unhandled." Then this part of the code is highlighted. "i < settings.Dirs.Length" There are several forms but this is the one I find the problem. namespace MemoryGame { /// <summary> /// Main form for …

Member Avatar for gusano79
0
836
Member Avatar for Andrei15193

Hello, I've browsed the C++ forums and on top is a list of C++ books, however I have not found a list of C# books. Can someone give me any directions on what C# books to buy and also an order of going through them? Thanks :)

Member Avatar for cschanchal
0
59
Member Avatar for complete

How does one write code to make drawings in the Windows main client area of a Win32 C++ app? I found an example online that uses the "eclipse" API but when I put it in my program, the IDE complained so it would not compile.

Member Avatar for Ancient Dragon
0
80
Member Avatar for shsh111

Given set of DNA sequences that all may be presented as xiwiyi, where x, y are unrelated random sequences, |x| & |y| < 5, and all wi are of the same but unknown length and are pretty similar how can i Propose and Implement SA algorithm that finds and describes …

Member Avatar for Ancient Dragon
0
47

The End.