Click here to Skip to main content
15,891,033 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
JokeRe: getting a Microsoft Visual studio C Runtime Library error and that error is showing its cursor in dbghook.c file Pin
Rajesh R Subramanian2-Apr-09 1:39
professionalRajesh R Subramanian2-Apr-09 1:39 
JokeRe: getting a Microsoft Visual studio C Runtime Library error and that error is showing its cursor in dbghook.c file Pin
Roger Stoltz2-Apr-09 1:43
Roger Stoltz2-Apr-09 1:43 
Questionnewbe question about arrays Pin
Jacavienna2-Apr-09 0:17
Jacavienna2-Apr-09 0:17 
AnswerRe: newbe question about arrays Pin
Rajesh R Subramanian2-Apr-09 0:21
professionalRajesh R Subramanian2-Apr-09 0:21 
GeneralRe: newbe question about arrays Pin
Jacavienna2-Apr-09 0:47
Jacavienna2-Apr-09 0:47 
GeneralGive us a clue Pin
Rajesh R Subramanian2-Apr-09 0:56
professionalRajesh R Subramanian2-Apr-09 0:56 
GeneralRe: Give us a clue Pin
Jacavienna2-Apr-09 1:14
Jacavienna2-Apr-09 1:14 
GeneralRe: newbe question about arrays Pin
Stuart Dootson2-Apr-09 2:19
professionalStuart Dootson2-Apr-09 2:19 
So...you get num from the user. You want to allocate an array of that size, then get num values from the user and put them into the array?

This should do:

#include <stdio.h>
int main(int argc, char** argv)
{
   int num;
   printf("Number of frequencies?\n");
   scanf("%d", &num);
   int*  freq = new int[num];
   for(int i=0;i<num;++i)
   {
      printf("Frequency %d?\n", i);
      scanf("%d", freq+i);
   }
   // Do stuff with the frequencies
   delete[] freq;
}


As Cedric said, you're probably better off using std::vector.

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

AnswerRe: newbe question about arrays Pin
_AnsHUMAN_ 2-Apr-09 0:26
_AnsHUMAN_ 2-Apr-09 0:26 
AnswerRe: newbe question about arrays Pin
Divyang Mithaiwala2-Apr-09 0:51
Divyang Mithaiwala2-Apr-09 0:51 
GeneralRe: newbe question about arrays Pin
Jacavienna2-Apr-09 1:01
Jacavienna2-Apr-09 1:01 
AnswerRe: newbe question about arrays Pin
Cedric Moonen2-Apr-09 1:01
Cedric Moonen2-Apr-09 1:01 
GeneralRe: newbe question about arrays Pin
Jacavienna2-Apr-09 1:10
Jacavienna2-Apr-09 1:10 
GeneralRe: newbe question about arrays Pin
Cedric Moonen2-Apr-09 1:14
Cedric Moonen2-Apr-09 1:14 
AnswerRe: newbe question about arrays Pin
David Crow2-Apr-09 3:23
David Crow2-Apr-09 3:23 
Questionany sync opration with vc++ concepts give a sample Pin
AshNis2-Apr-09 0:11
AshNis2-Apr-09 0:11 
AnswerRe: any sync opration with vc++ concepts give a sample Pin
_AnsHUMAN_ 2-Apr-09 0:21
_AnsHUMAN_ 2-Apr-09 0:21 
AnswerRe: any sync opration with vc++ concepts give a sample Pin
Iain Clarke, Warrior Programmer2-Apr-09 5:39
Iain Clarke, Warrior Programmer2-Apr-09 5:39 
QuestionHow to delete CStatic object. Pin
hemlat1-Apr-09 23:01
hemlat1-Apr-09 23:01 
AnswerRe: How to delete CStatic object. Pin
Code-o-mat1-Apr-09 23:36
Code-o-mat1-Apr-09 23:36 
GeneralRe: How to delete CStatic object. Pin
hemlat1-Apr-09 23:39
hemlat1-Apr-09 23:39 
GeneralRe: How to delete CStatic object. Pin
Code-o-mat1-Apr-09 23:54
Code-o-mat1-Apr-09 23:54 
GeneralRe: How to delete CStatic object. Pin
hemlat2-Apr-09 0:09
hemlat2-Apr-09 0:09 
GeneralRe: How to delete CStatic object. Pin
Maximilien2-Apr-09 0:15
Maximilien2-Apr-09 0:15 
GeneralRe: How to delete CStatic object. Pin
Code-o-mat2-Apr-09 0:25
Code-o-mat2-Apr-09 0:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.