19,876 Topics

Member Avatar for
Member Avatar for needhelpalways

#include<stdio.h> #define ROW 5 #define COL 5 int main(){ int array[ROW][COL]; int r=0, c=0; for (r=0; r<ROW; r++){ for (c=0; c<COL; c++) array[c][r] = (c+1)-(r+1); } for (r=0; r<ROW; r++){ for (c=0; c<COL; c++) printf("%5d", array[c][r]); printf("\n"); } printf("\n\n"); system("pause"); return 0; } i need help in this code I …

Member Avatar for Nutster
0
299
Member Avatar for collin_ola

Hi, I seem to be having a problem with my code below, which I would like to be able to use to return 2 values from the result of a quadratic equation operation. The eReturn function takes care of negative square root values. I'm not getting any errors back, just …

Member Avatar for Miorfs
0
3K
Member Avatar for kidpro

i want to print myname mynam myna myn my m i have done in numbers but i can't print in string/char my code is i want to print myname mynam myna myn my m i have done in numbers but i can't print in string/char my code is main() { …

Member Avatar for Miorfs
0
160
Member Avatar for brand.lock

First off thanks for looking at this I have looked all over (both here and on the net) and tried several things trying to get this to work. I am using Visual Studio 2012 with DirectX (June 2010) SDK. I am attempting to write a fuctuin for sprite colission detection. …

0
76
Member Avatar for saurabh.mehta.33234

Does the following code make p as a null pointer static int *p; since `printf("%u",p);` outputs as 0 though the syntax is `int *p=NULL or int *p=0`

Member Avatar for deceptikon
0
157
Member Avatar for rajilakshmi

Find the number of sequences in an integer array. A sequence is a list of numbers that comes in strict numerical order like [3, 4, 5, 6]. Sample Input : [1, 2, 3, 6, 8, 10, 11, 15, 16, 17] Sample Output : 3 sequences Any one can hlp please? …

Member Avatar for Adak
0
168
Member Avatar for StNtMaN

**C++ Code:** #include <iostream> using namespace std; int sum(int n) { if (n <= 0) return 0; else return n + sum(n-1); } int main() { cout << "Range num? "; int num; cin >> num; cout << sum(num) << endl; return 0; } **My Pep/8 try at it:** br …

0
69
Member Avatar for noahjonesnoah

Hi all, Im trying to write a program that minimizes a Transition Graph (its basically combining states with similar numbers). Basically, the algorithm is to first find states with the same 'a' and 'b' inputs, combine them, remove them from the 'leftovers' list, then find states that have either 'a' …

Member Avatar for Adak
0
138
Member Avatar for gtsiga
Member Avatar for caKus
0
218
Member Avatar for chandnigandhi

I am making a text editor in c language.I need a help for moving characters left,right,up and down.I am using turbo c compiler and i want code for navigation and not an ascii key codes.... please help me with this as soon as possible....

Member Avatar for deceptikon
0
153
Member Avatar for Jbvo

I am trying to read each word from a file and put it in a pointer then send it to a vector. Here is what I have so far. I am having a hard time sending the data to a function where I will add it to a vector. Here …

Member Avatar for Mephesh
0
155
Member Avatar for miracle Kimuli

pleas help me Write an algorithm to add and multiply two large integers, which cannot be represented by built-in types.

Member Avatar for Adak
0
173
Member Avatar for ashrafbd

hello i was trying to do one of my assignments but i got stuck at sorting my strut arrays elements by alphabetical order. here is the code that i have dose so far but after this even reading as much as i can, i can not get to go any …

Member Avatar for Adak
0
135
Member Avatar for JohnMcPherson

I am trying read CSV files in a C program on an AIX system. I am having problems getting fscanf to recognize the comma delimeter. I have read previous posts on this issue, and used the techniques dicussed in those threads, but I am still having the issue. Specifically, this …

Member Avatar for JohnMcPherson
0
6K
Member Avatar for celina1234

I have two files which goes like this : FILE A is : J5 J15 J25 J30 J35 and FILE B is: J0 23 56 J5 24 58 J10 26 60 J15 29 63 J20 31 36 J25 23 32 J30 51 14 J35 34 21 J40 46 12 The …

Member Avatar for Ancient Dragon
0
186
Member Avatar for saarthak pande
Member Avatar for myk45

Hello All, I have a small doubt w.r.t using mutex locks. Say we have a thread-safe function: int counter; void foo() { LOCK_MUTEX(); // say by pthread_mutex_lock ++counter; UNLOCK_MUTEX(); } Now, i understand that this is thread safe because only one thread can "own" a mutex at a time and …

Member Avatar for myk45
0
188
Member Avatar for chipbu

Hi guys, This is not related to syntax or runtime problem. What I am going ask is more about how Linux and Windows handle writing data from buffer to a file. I have this code here, wrapped around a timing block, to write a buffer to a file. StartCounter(); if(rows …

Member Avatar for Adak
0
282
Member Avatar for Stpdoug

Having a small a problem with an array value here is the code:i want the array(totalwin) to store the value of the calulation each time it repeats say 10 times.I tried using the for loop but the values are not stored in the array what am i doing wrong. // …

Member Avatar for Stpdoug
0
192
Member Avatar for DanteX

> Hello Can Someone please help me with this problem. This is what i have sofar but i am not sure whats missing or how to end it please help. A solid steel column of circular cross section is needed to support a load of 65,000 lb. The ends of …

Member Avatar for Schol-R-LEA
0
173
Member Avatar for Echo89

Well, I have just made this funtion that will split an array using a delimiter. I'm new to C++ so I will take any suggestions you have. Anyhow, good luck! Enjoy!

Member Avatar for Echo89
0
991
Member Avatar for kostaskol

Hello there people. I am pretty new in C and programming in general. I was trying to make a password checking programme and I seem to be stuck. int main (void) {char ch; while ((ch=getchar()) != EOF){ This is the beginning of my code and whenever I try to type …

Member Avatar for kostaskol
0
125
Member Avatar for starkk

#include<stdio.h> int myatoi(const char *string); int main(int argc, char* argv[]) { printf("\n%d\n", myatoi("1998")); getch(); return(0); } int myatoi(const char* string) { int value = 0; if (string) { while (*string && (*string <= '9' && *string >= '0')) { value = (value * 10) + (*string - '0'); string++; } …

Member Avatar for nullptr
0
108
Member Avatar for Akintunde Dare
Member Avatar for priyambada1

Given an array A of n integers, give an eficient algorithm to check whether there are two numbers in A whose sum is zero. [

Member Avatar for Symbiatch
0
71
Member Avatar for gandalf22

Alright so im supposed to represent an airline. total # of seats is 10. Passangers can choose whether to sit in first or economy. This is what i have so far. If you try the program and try to go from first to economy you will see that it skips …

Member Avatar for zeroliken
0
176
Member Avatar for some one

[CODE]#include <conio.h> #include <graphics.h> #include <stdlib.h> #include <stdio.h> void main (int) { int gdriver=DETECT,gmode,errorcode; //Requesting auto-detection. int midx,midy,x; //Initializing graphics and local variables. initgraph(&gdriver,&gmode,"d:\\bc3\\bgi"); //Reading result of initialization. errorcode=graphresult(); if(errorcode!=grOk) //An error occurred. { printf("Graphics error occurred : %s \n",grapherrormsg(errorcode)); printf("Press any key to stop : "); getch(); exit(1); //Terminate …

Member Avatar for kadawe
0
848
Member Avatar for saddam777

Write a code snippet to declare and accept an integer and calculate the cube value of the integer. The integer should be passed by reference to a function cube(). The function would calculate the result of cubing the integer. The function prototype to be used is: void cube (int *p); …

Member Avatar for <M/>
0
149
Member Avatar for saddam777

1) The & symbol in C returns the address of a variable. 2) In the expression, `printf(“%d”, (ans > val)? z : w);` displays the value of w if the condition is true. 3) In the expression, `for( ; a>b; )` A semicolon on its own indicates a null statement. …

Member Avatar for Ancient Dragon
0
142
Member Avatar for saddam777

Write a code snippet to declare and accept an integer and calculate the cube value of the integer. The integer should be passed by reference to a function cube(). The function would calculate the result of cubing the integer. The function prototype to be used is: void cube (int *p); …

Member Avatar for Stpdoug
0
58
Member Avatar for jcmoney1010

I'm able to import the file and read it, but I don't think it's saving to the structure. I want to figure out how to save it within the structure so I can search/ delete the contacts. The unfortunately lengthy code is below: #include <stdio.h> #include <string.h> #include <stdlib.h> #include …

Member Avatar for Ancient Dragon
1
192
Member Avatar for TheSmartOne1

I can't figure out why a gives a value of 0, Can anyone explain? Thanks in advance. The output for this program is 770 include<stdio.h> include<stdlib.h> int a,b; void mystery(){ while(b>0){ int a; a=a+10; b=b-1; } } int main(){ a=7; b=a; printf("%d\n",a); mystery(); printf("%d\n",a); printf("%d\n",b); system("pause") return 0; }

Member Avatar for deceptikon
0
74
Member Avatar for adlinaalbert

please help me choose an title to do a package using **binary tree** or **multiply linked** list data structure....

Member Avatar for deceptikon
1
36
Member Avatar for Ranger86

Hello I'm new to C++ and am trying my best to learn the language. Could someone please let me know why my program is not working. I have a feeling that I'm not passing values to and from functions. The program compiles and runs, but it just gives me a …

Member Avatar for VernonDozier
0
321
Member Avatar for dot_binary

I'm using winapi function GetTickCount() with delta time and I'm calculating the displacement of an object on screen like this: number_Of_Pixels_To_Move_On_Screen = (speed*delta_Time)/number_Of_Pixels_Per_Milllisecond but I get uneven movement.Sometimes it moves a litle faster ,sometimes slower . Can someone tell me how to get the object to move at a constant …

Member Avatar for mrnutty
0
171
Member Avatar for UrFace

Write a C# program that searches a file for a string. Pass the string and the file name as program arguments.

Member Avatar for Momerath
-2
40
Member Avatar for jcmoney1010

Alright to add the ability to import files into a phonebook app that I created, but my issue im having is when I just add a counter to loop through the function that pulls the data from the file, it prints out names many different times, in different orders. I …

Member Avatar for Ancient Dragon
0
134
Member Avatar for celina1234

I am very new to programming language and need help urgently. I am running a program which gives me one output file for every 5 min simulation. i have to copy and rename the output file in each step so that they can be used in another program . Any …

Member Avatar for Adak
0
305
Member Avatar for SCass2010

Hi everyone, Currently for a university project I am building a server that can send notifications to a mobile device. Part of the project involves building a front end where I can configure everything for the server - updates to send, rules and so on. On the front end I …

Member Avatar for nmaillet
0
259
Member Avatar for ppotter3

Hello! How is everyone? I know this program is somewhat simple, but I am working on learning classes, and I am trying to implement this in my code. I pretty sure my mathematics done in the program are correct, or at least on the write track. Here's what I am …

Member Avatar for magadascar
0
2K
Member Avatar for alaa sam

Hi everyone I'm using stat() function to get the file's attributes , but I don't know how to get the permission of it . So can anyone tell me how to find the permission of the file?? Thanks in advance

Member Avatar for alaa sam
0
840
Member Avatar for leesin

#include <stdio.h> #include <stdlib.h> int main(void) { double a = 0.0; double b = 0.0; scanf("%lf", &a); printf("\nThe first number is %f", a); getchar(); return EXIT_SUCCESS; } The question is : how can the program continually re-prompt I mean when i enter the number, and then the number i entered …

Member Avatar for Ancient Dragon
0
96
Member Avatar for noahjonesnoah
Member Avatar for Ancient Dragon
0
60
Member Avatar for Jenniferting

Credit card numbers follow certain patterns. A credit card number must have between 13 and 19 digits. It must start with for example: 4 for Visa cards 5 for Master cards 37 for American Express cards 6 for Discover cards So, this here is the code thats identify either a …

Member Avatar for Ancient Dragon
0
252
Member Avatar for XEN0

Rewrote this a few times heres the meat and potatoes. Has a few issues such as flashing when moving in different directions quickly. Thinking of trying to clamp a few values to try to stop the diagonal movement,flashing and smoothing out the sprite. Something along these lines might update this …

Member Avatar for XEN0
0
269
Member Avatar for syeda amna

Hi I need some good study material related to it. How can i eject my DVD ROM drive using C coding. similarly, how can i change fan speed, how can i shut down my PC using C coding. I need urgently.

Member Avatar for BobS0327
0
4K
Member Avatar for jonny93

What is the best way to practice C++ coding on Windows 7, and at the very least free? I want to get better at programming, but I don't have a compiler.

Member Avatar for mike_2000_17
0
904
Member Avatar for Some Dude

Alright. I am making some decent progress here. I am trying to add a toolbar to my basic text editor that I am making using an internet tutorial. Anyways the problem is that I can get the bitmaps to display but they appear to be just that... bitmaps. When I …

Member Avatar for Some Dude
0
477
Member Avatar for sujan.dasmahapa

I apologize for the inconvenience this not a Qt question. I am using a library in my Qt application which is built and generated by lex and yacc compiler. When I am calling first time the function it’s working fine, a good file. Next time running a bad file from …

0
63
Member Avatar for Musa_Jutt

Guys I installed "windows Vituual PC" with xp vesion in windows 7 ultimate 64 bit. Now I am not able to install c++ software in it so please tell me how to install turbo c++ in VMplayer plzzzzzzzz full detail .

Member Avatar for Ancient Dragon
0
46

The End.